Here's the code I'm using to create a button on the standard toolbar in an
open email in outlook. The event is firing, b/c I get the "New Inspector"
msgbox to appear, but then I always get "error creating button". This code
for creating a button works in the main outlook window, but it does not when
an email is opened in a new window. Please help.
Private Sub myOlInspectors_NewInspector(ByVal Inspector As
Outlook.Inspector) Handles myOlInspectors.NewInspector
' Create button on Standard Toolbar in Outlook when Outlook starts
Dim objStandardBar As CommandBar
I am puzzled this code doesn't work with you. I have tested it in VB.NET. All works fine.
Try to put the following code:
Private Sub AddinModule_OlNewInspector(ByVal sender As Object, ByVal inspector As Object, ByVal folderName As String) Handles MyBase.OlNewInspector
Dim objStandardBar As Microsoft.Office.Core.CommandBar
objStandardBar = inspector.CommandBars.Item("Standard")
btnCombine = objStandardBar.FindControl(Type:=Microsoft.Office.Core.MsoControlType.msoControlButton, Tag:="12F6BC46-9D04-4c1a-A4E5-64BB756410B4", Recursive:=True)
If btnCombine Is Nothing Then
btnCombine = CType(objStandardBar.Controls.Add(Type:=Microsoft.Office.Core.MsoControlType.msoControlButton, Temporary:=True), Microsoft.Office.Core.CommandBarButton)
btnCombine.Caption = "My Button"
btnCombine.Tag = "12F6BC46-9D04-4c1a-A4E5-64BB756410B4"
Catch e As Exception
Solid framework for deep customization of Microsoft Office. Use solution templates,
visual designers and components to develop version-neutral, secure and easy deployable extensions for all Office versions.
Supported Office extensions
COM add-ins, Outlook plug-ins, RTD servers, smart tags, Excel XLL and UDF
This technology is now available for our custom development services only. Based on the Add-in Express for Office core, it is designed for building custom-tailored Office add-ins with far less coding than you usually have to do. Plus, it includes all Add-in Express features such as True RAD, visual designers, Outlook view and form regions, etc.
Extensions: VSTO-based application-level Office add-ins
Applications: Outlook, Excel, Word, PowerPoint, Visio, InfoPath
Office versions: 2003, 2007, 2010 (x86 and x64)
IDE: VSTO 2005 SE, 2008, 2010; VB.NET, C#
for Microsoft® Office and Delphi® VCL
Get the best platform for building version-neutral, fast and easy deployable plug-ins by using Add-in Express projects templates, visual designers, components and wizards in combination with a perfect Delphi compiler.
Supported Office extensions
COM add-ins, Outlook plug-ins, smart tags, Excel RTD and UDF
This is an extension for Visual Studio that allows developers to quickly create WiX-based setup projects in a familiar Visual Studio way.
The Designer for WiX Toolset lets you forget the plain Windows Installer XML and concentrate on your deployment logic. It integrates several editors with the Visual Studio IDE and provides a set of vdproj designers to configure the file system, registry, user interface, custom actions, launch conditions and more for your setup projects.
Visual Studio versions: 2010, 2012, 2013, 2015, 2017, 2019
This technology is now available for our custom development services only. This visual toolkit allows creating secure, managed, isolated, deployable and version-neutral plug-ins for Outlook Express and Windows Mail. It provides powerful solution templates, Outlook Express - specific components, visual designers and wizards for advanced customization of Outlook Express menus, toolbars, panes and regions.
Extensions: Outlook Express plug-ins
Versions: Outlook Express 6.x, Windows Mail 6.x
IDE: VS 2005, 2008; VB.NET, C#, C++/CLI
The innovative technology for customizing Outlook views and forms. It is included in all Add-in Express for Office products and can be used to extend Outlook views, e-mail, task and appointment windows, To-Do bar, Reading and Navigation panes with your own custom sub-panes.
Extensions: application-level Outlook add-ins
Outlook versions: 2000, 2002, 2003, 2007, 2010 (x86 and x64)
.NET Edition: VS 2005, 2008, 2010; VB.NET, C#, C++/CLI
.NET Framework: 2.0 and higher
VCL Edition: Delphi 5 - XE
Microsoft and the Office logo are trademarks or registered trademarks of Microsoft Corporation in
the United States and/or other countries. All other trademarks are property of their respective owners.