![]() |
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
Does anyone know how to do this? I have seen code on anding additional Menu,
but not how to add items to existing ones. Thanks in advance! |
Ads |
#2
|
|||
|
|||
![]()
CommandBar.Controls.Add is the method you use to add new items to any CommandBar in the Explorer.CommandBars collection.
-- Sue Mosher, Outlook MVP Author of Microsoft Outlook 2007 Programming: Jumpstart for Power Users and Administrators http://www.outlookcode.com/article.aspx?id=54 "Rudy" wrote in message news ![]() Does anyone know how to do this? I have seen code on anding additional Menu, but not how to add items to existing ones. Thanks in advance! |
#3
|
|||
|
|||
![]()
Still having problems with this. The item does not show up on the Tools menu
in Outlook 2007. I looked at this code here http://msdn.microsoft.com/archive/de...ce06062002.asp and copied it into an empty VB.NET 2005 COM project but when I run it the item I wnat still does not appear!! Have you any more examples? Thanks in advance! "Sue Mosher [MVP-Outlook]" wrote: CommandBar.Controls.Add is the method you use to add new items to any CommandBar in the Explorer.CommandBars collection. -- Sue Mosher, Outlook MVP Author of Microsoft Outlook 2007 Programming: Jumpstart for Power Users and Administrators http://www.outlookcode.com/article.aspx?id=54 "Rudy" wrote in message news ![]() Does anyone know how to do this? I have seen code on anding additional Menu, but not how to add items to existing ones. Thanks in advance! |
#4
|
|||
|
|||
![]()
It might help if you showed the code snippet that adds the new control(s). Remember that in Outlook, CommandBars are a property of the Explorer object, not Application. The sample at http://msdn2.microsoft.com/en-us/library/Aa155703 is good for shared add-ins.
-- Sue Mosher, Outlook MVP Author of Microsoft Outlook 2007 Programming: Jumpstart for Power Users and Administrators http://www.outlookcode.com/article.aspx?id=54 "Rudy" wrote in message ... Still having problems with this. The item does not show up on the Tools menu in Outlook 2007. I looked at this code here http://msdn.microsoft.com/archive/de...ce06062002.asp and copied it into an empty VB.NET 2005 COM project but when I run it the item I wnat still does not appear!! Have you any more examples? Thanks in advance! "Sue Mosher [MVP-Outlook]" wrote: CommandBar.Controls.Add is the method you use to add new items to any CommandBar in the Explorer.CommandBars collection. "Rudy" wrote in message news ![]() Does anyone know how to do this? I have seen code on anding additional Menu, but not how to add items to existing ones. Thanks in advance! |
#5
|
|||
|
|||
![]()
The following is the code I have which is meant to add the item.
Public Sub OnStartupComplete(ByRef custom As System.Array) Implements Extensibility.IDTExtensibility2.OnStartupComplete ' *** BEGIN CUSTOM CODE. *** Dim objCommandBars As CommandBars Dim objCommandBar As CommandBar Dim objCommandBarControl As CommandBarControl ' Create a menu command on the "Tools" menu. objCommandBars = applicationObject.CommandBars objCommandBar = objCommandBars.Item("Tools") ' Make sure menu command doesn't already exist. For Each objCommandBarControl In objCommandBar.Controls If objCommandBarControl.Caption = "Slides from Graphics..." Then objCommandBar.Controls.Item("Slides from Graphics...").Delete() End If Next objCommandBarControl objCommandBarButton = objCommandBar.Controls.Add(msoControlButton) With objCommandBarButton .Caption = "New Slides from Graphics..." .Style = msoButtonCaption .Tag = "Slides from Graphics..." .OnAction = "!PowerPointAddIn.Connect" .Visible = True End With ' *** END CUSTOM CODE. *** End Sub I will investigate using the Explorer object. "Sue Mosher [MVP-Outlook]" wrote: It might help if you showed the code snippet that adds the new control(s). Remember that in Outlook, CommandBars are a property of the Explorer object, not Application. The sample at http://msdn2.microsoft.com/en-us/library/Aa155703 is good for shared add-ins. -- Sue Mosher, Outlook MVP Author of Microsoft Outlook 2007 Programming: Jumpstart for Power Users and Administrators http://www.outlookcode.com/article.aspx?id=54 "Rudy" wrote in message ... Still having problems with this. The item does not show up on the Tools menu in Outlook 2007. I looked at this code here http://msdn.microsoft.com/archive/de...ce06062002.asp and copied it into an empty VB.NET 2005 COM project but when I run it the item I wnat still does not appear!! Have you any more examples? Thanks in advance! "Sue Mosher [MVP-Outlook]" wrote: CommandBar.Controls.Add is the method you use to add new items to any CommandBar in the Explorer.CommandBars collection. "Rudy" wrote in message news ![]() but not how to add items to existing ones. Thanks in advance! |
#6
|
|||
|
|||
![]()
This definitely is your problem:
objCommandBars = applicationObject.CommandBars Your code should check to see whether an ActiveExplorer object exists and, if it does, use its CommandBars. -- Sue Mosher, Outlook MVP Author of Microsoft Outlook 2007 Programming: Jumpstart for Power Users and Administrators http://www.outlookcode.com/article.aspx?id=54 "Rudy" wrote in message ... The following is the code I have which is meant to add the item. Public Sub OnStartupComplete(ByRef custom As System.Array) Implements Extensibility.IDTExtensibility2.OnStartupComplete ' *** BEGIN CUSTOM CODE. *** Dim objCommandBars As CommandBars Dim objCommandBar As CommandBar Dim objCommandBarControl As CommandBarControl ' Create a menu command on the "Tools" menu. objCommandBars = applicationObject.CommandBars objCommandBar = objCommandBars.Item("Tools") ' Make sure menu command doesn't already exist. For Each objCommandBarControl In objCommandBar.Controls If objCommandBarControl.Caption = "Slides from Graphics..." Then objCommandBar.Controls.Item("Slides from Graphics...").Delete() End If Next objCommandBarControl objCommandBarButton = objCommandBar.Controls.Add(msoControlButton) With objCommandBarButton .Caption = "New Slides from Graphics..." .Style = msoButtonCaption .Tag = "Slides from Graphics..." .OnAction = "!PowerPointAddIn.Connect" .Visible = True End With ' *** END CUSTOM CODE. *** End Sub I will investigate using the Explorer object. "Sue Mosher [MVP-Outlook]" wrote: It might help if you showed the code snippet that adds the new control(s). Remember that in Outlook, CommandBars are a property of the Explorer object, not Application. The sample at http://msdn2.microsoft.com/en-us/library/Aa155703 is good for shared add-ins. "Rudy" wrote in message ... Still having problems with this. The item does not show up on the Tools menu in Outlook 2007. I looked at this code here http://msdn.microsoft.com/archive/de...ce06062002.asp and copied it into an empty VB.NET 2005 COM project but when I run it the item I wnat still does not appear!! Have you any more examples? Thanks in advance! "Sue Mosher [MVP-Outlook]" wrote: CommandBar.Controls.Add is the method you use to add new items to any CommandBar in the Explorer.CommandBars collection. "Rudy" wrote in message news ![]() but not how to add items to existing ones. Thanks in advance! |
#7
|
|||
|
|||
![]()
I can only see a reference to the ActiveExplorer object in VBA. I don't see a
reference for it in VB.NET and I think this is my problem. Do I use VBA to add the button to the Tools item or is there a way to use VB.NET? "Sue Mosher [MVP-Outlook]" wrote: This definitely is your problem: objCommandBars = applicationObject.CommandBars Your code should check to see whether an ActiveExplorer object exists and, if it does, use its CommandBars. -- Sue Mosher, Outlook MVP Author of Microsoft Outlook 2007 Programming: Jumpstart for Power Users and Administrators http://www.outlookcode.com/article.aspx?id=54 "Rudy" wrote in message ... The following is the code I have which is meant to add the item. Public Sub OnStartupComplete(ByRef custom As System.Array) Implements Extensibility.IDTExtensibility2.OnStartupComplete ' *** BEGIN CUSTOM CODE. *** Dim objCommandBars As CommandBars Dim objCommandBar As CommandBar Dim objCommandBarControl As CommandBarControl ' Create a menu command on the "Tools" menu. objCommandBars = applicationObject.CommandBars objCommandBar = objCommandBars.Item("Tools") ' Make sure menu command doesn't already exist. For Each objCommandBarControl In objCommandBar.Controls If objCommandBarControl.Caption = "Slides from Graphics..." Then objCommandBar.Controls.Item("Slides from Graphics...").Delete() End If Next objCommandBarControl objCommandBarButton = objCommandBar.Controls.Add(msoControlButton) With objCommandBarButton .Caption = "New Slides from Graphics..." .Style = msoButtonCaption .Tag = "Slides from Graphics..." .OnAction = "!PowerPointAddIn.Connect" .Visible = True End With ' *** END CUSTOM CODE. *** End Sub I will investigate using the Explorer object. "Sue Mosher [MVP-Outlook]" wrote: It might help if you showed the code snippet that adds the new control(s). Remember that in Outlook, CommandBars are a property of the Explorer object, not Application. The sample at http://msdn2.microsoft.com/en-us/library/Aa155703 is good for shared add-ins. "Rudy" wrote in message ... Still having problems with this. The item does not show up on the Tools menu in Outlook 2007. I looked at this code here http://msdn.microsoft.com/archive/de...ce06062002.asp and copied it into an empty VB.NET 2005 COM project but when I run it the item I wnat still does not appear!! Have you any more examples? Thanks in advance! "Sue Mosher [MVP-Outlook]" wrote: CommandBar.Controls.Add is the method you use to add new items to any CommandBar in the Explorer.CommandBars collection. "Rudy" wrote in message news ![]() but not how to add items to existing ones. Thanks in advance! |
#8
|
|||
|
|||
![]()
If you're building an add-in, you use VB.NET. Did you look at the sample I suggested? Pay attention in particular to the InitHandler procedure.
-- Sue Mosher, Outlook MVP Author of Microsoft Outlook 2007 Programming: Jumpstart for Power Users and Administrators http://www.outlookcode.com/article.aspx?id=54 "Rudy" wrote in message ... I can only see a reference to the ActiveExplorer object in VBA. I don't see a reference for it in VB.NET and I think this is my problem. Do I use VBA to add the button to the Tools item or is there a way to use VB.NET? "Sue Mosher [MVP-Outlook]" wrote: This definitely is your problem: objCommandBars = applicationObject.CommandBars Your code should check to see whether an ActiveExplorer object exists and, if it does, use its CommandBars. "Rudy" wrote in message ... The following is the code I have which is meant to add the item. Public Sub OnStartupComplete(ByRef custom As System.Array) Implements Extensibility.IDTExtensibility2.OnStartupComplete ' *** BEGIN CUSTOM CODE. *** Dim objCommandBars As CommandBars Dim objCommandBar As CommandBar Dim objCommandBarControl As CommandBarControl ' Create a menu command on the "Tools" menu. objCommandBars = applicationObject.CommandBars objCommandBar = objCommandBars.Item("Tools") ' Make sure menu command doesn't already exist. For Each objCommandBarControl In objCommandBar.Controls If objCommandBarControl.Caption = "Slides from Graphics..." Then objCommandBar.Controls.Item("Slides from Graphics...").Delete() End If Next objCommandBarControl objCommandBarButton = objCommandBar.Controls.Add(msoControlButton) With objCommandBarButton .Caption = "New Slides from Graphics..." .Style = msoButtonCaption .Tag = "Slides from Graphics..." .OnAction = "!PowerPointAddIn.Connect" .Visible = True End With ' *** END CUSTOM CODE. *** End Sub I will investigate using the Explorer object. "Sue Mosher [MVP-Outlook]" wrote: It might help if you showed the code snippet that adds the new control(s). Remember that in Outlook, CommandBars are a property of the Explorer object, not Application. The sample at http://msdn2.microsoft.com/en-us/library/Aa155703 is good for shared add-ins. "Rudy" wrote in message ... Still having problems with this. The item does not show up on the Tools menu in Outlook 2007. I looked at this code here http://msdn.microsoft.com/archive/de...ce06062002.asp and copied it into an empty VB.NET 2005 COM project but when I run it the item I wnat still does not appear!! Have you any more examples? Thanks in advance! "Sue Mosher [MVP-Outlook]" wrote: CommandBar.Controls.Add is the method you use to add new items to any CommandBar in the Explorer.CommandBars collection. "Rudy" wrote in message news ![]() but not how to add items to existing ones. Thanks in advance! |
#9
|
|||
|
|||
![]()
The Me.ActiveExplorer definately is not available to me in VB.NET 2005. I
have VTSO Office Tools installed. Am I missing a class or something?? "Sue Mosher [MVP-Outlook]" wrote: This definitely is your problem: objCommandBars = applicationObject.CommandBars Your code should check to see whether an ActiveExplorer object exists and, if it does, use its CommandBars. -- Sue Mosher, Outlook MVP Author of Microsoft Outlook 2007 Programming: Jumpstart for Power Users and Administrators http://www.outlookcode.com/article.aspx?id=54 "Rudy" wrote in message ... The following is the code I have which is meant to add the item. Public Sub OnStartupComplete(ByRef custom As System.Array) Implements Extensibility.IDTExtensibility2.OnStartupComplete ' *** BEGIN CUSTOM CODE. *** Dim objCommandBars As CommandBars Dim objCommandBar As CommandBar Dim objCommandBarControl As CommandBarControl ' Create a menu command on the "Tools" menu. objCommandBars = applicationObject.CommandBars objCommandBar = objCommandBars.Item("Tools") ' Make sure menu command doesn't already exist. For Each objCommandBarControl In objCommandBar.Controls If objCommandBarControl.Caption = "Slides from Graphics..." Then objCommandBar.Controls.Item("Slides from Graphics...").Delete() End If Next objCommandBarControl objCommandBarButton = objCommandBar.Controls.Add(msoControlButton) With objCommandBarButton .Caption = "New Slides from Graphics..." .Style = msoButtonCaption .Tag = "Slides from Graphics..." .OnAction = "!PowerPointAddIn.Connect" .Visible = True End With ' *** END CUSTOM CODE. *** End Sub I will investigate using the Explorer object. "Sue Mosher [MVP-Outlook]" wrote: It might help if you showed the code snippet that adds the new control(s). Remember that in Outlook, CommandBars are a property of the Explorer object, not Application. The sample at http://msdn2.microsoft.com/en-us/library/Aa155703 is good for shared add-ins. "Rudy" wrote in message ... Still having problems with this. The item does not show up on the Tools menu in Outlook 2007. I looked at this code here http://msdn.microsoft.com/archive/de...ce06062002.asp and copied it into an empty VB.NET 2005 COM project but when I run it the item I wnat still does not appear!! Have you any more examples? Thanks in advance! "Sue Mosher [MVP-Outlook]" wrote: CommandBar.Controls.Add is the method you use to add new items to any CommandBar in the Explorer.CommandBars collection. "Rudy" wrote in message news ![]() but not how to add items to existing ones. Thanks in advance! |
#10
|
|||
|
|||
![]()
Your original post indicated you were using the IDTExtensibility2 shared add-in architecture. Now, you mention VSTO. The two use completely different means to return an Outlook.Application object, from which all other Outlook objects can be derived. So which are you using?
-- Sue Mosher, Outlook MVP Author of Microsoft Outlook 2007 Programming: Jumpstart for Power Users and Administrators http://www.outlookcode.com/article.aspx?id=54 "Rudy" wrote in message ... The Me.ActiveExplorer definately is not available to me in VB.NET 2005. I have VTSO Office Tools installed. Am I missing a class or something?? "Sue Mosher [MVP-Outlook]" wrote: This definitely is your problem: objCommandBars = applicationObject.CommandBars Your code should check to see whether an ActiveExplorer object exists and, if it does, use its CommandBars. "Rudy" wrote in message ... The following is the code I have which is meant to add the item. Public Sub OnStartupComplete(ByRef custom As System.Array) Implements Extensibility.IDTExtensibility2.OnStartupComplete ' *** BEGIN CUSTOM CODE. *** Dim objCommandBars As CommandBars Dim objCommandBar As CommandBar Dim objCommandBarControl As CommandBarControl ' Create a menu command on the "Tools" menu. objCommandBars = applicationObject.CommandBars objCommandBar = objCommandBars.Item("Tools") ' Make sure menu command doesn't already exist. For Each objCommandBarControl In objCommandBar.Controls If objCommandBarControl.Caption = "Slides from Graphics..." Then objCommandBar.Controls.Item("Slides from Graphics...").Delete() End If Next objCommandBarControl objCommandBarButton = objCommandBar.Controls.Add(msoControlButton) With objCommandBarButton .Caption = "New Slides from Graphics..." .Style = msoButtonCaption .Tag = "Slides from Graphics..." .OnAction = "!PowerPointAddIn.Connect" .Visible = True End With ' *** END CUSTOM CODE. *** End Sub I will investigate using the Explorer object. "Sue Mosher [MVP-Outlook]" wrote: It might help if you showed the code snippet that adds the new control(s). Remember that in Outlook, CommandBars are a property of the Explorer object, not Application. The sample at http://msdn2.microsoft.com/en-us/library/Aa155703 is good for shared add-ins. "Rudy" wrote in message ... Still having problems with this. The item does not show up on the Tools menu in Outlook 2007. I looked at this code here http://msdn.microsoft.com/archive/de...ce06062002.asp and copied it into an empty VB.NET 2005 COM project but when I run it the item I wnat still does not appear!! Have you any more examples? Thanks in advance! "Sue Mosher [MVP-Outlook]" wrote: CommandBar.Controls.Add is the method you use to add new items to any CommandBar in the Explorer.CommandBars collection. "Rudy" wrote in message news ![]() but not how to add items to existing ones. Thanks in advance! |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
I can't find Research on my Tools Menu. | need dictionary | Outlook - Using Contacts | 1 | December 10th 06 07:48 PM |
send icon in tools menu | wiola | Outlook - General Queries | 1 | November 2nd 06 04:05 AM |
Tools menu has only Address Book items on it | d d | Outlook Express | 5 | July 30th 06 01:11 PM |
Add-in menu items do not show up under tools | Chicago484 | Outlook - Installation | 0 | May 19th 06 04:56 PM |
accounts missing from tools menu | John | Outlook Express | 1 | February 22nd 06 04:47 AM |