A Microsoft Outlook email forum. Outlook Banter

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.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook - Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Add New Menu items to the Tools Menu in Outlook 2007



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old July 18th 07, 03:18 PM posted to microsoft.public.outlook.program_forms
Rudy
external usenet poster
 
Posts: 10
Default Add New Menu items to the Tools Menu in Outlook 2007

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  
Old July 18th 07, 04:34 PM posted to microsoft.public.outlook.program_forms
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default Add New Menu items to the Tools Menu in Outlook 2007

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  
Old July 23rd 07, 09:30 AM posted to microsoft.public.outlook.program_forms
Rudy
external usenet poster
 
Posts: 10
Default Add New Menu items to the Tools Menu in Outlook 2007

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  
Old July 23rd 07, 12:20 PM posted to microsoft.public.outlook.program_forms
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default Add New Menu items to the Tools Menu in Outlook 2007

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  
Old July 23rd 07, 01:30 PM posted to microsoft.public.outlook.program_forms
Rudy
external usenet poster
 
Posts: 10
Default Add New Menu items to the Tools Menu in Outlook 2007

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 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!


  #6  
Old July 23rd 07, 02:02 PM posted to microsoft.public.outlook.program_forms
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default Add New Menu items to the Tools Menu in Outlook 2007

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 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!


  #7  
Old July 23rd 07, 02:46 PM posted to microsoft.public.outlook.program_forms
Rudy
external usenet poster
 
Posts: 10
Default Add New Menu items to the Tools Menu in Outlook 2007

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 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!



  #8  
Old July 23rd 07, 03:21 PM posted to microsoft.public.outlook.program_forms
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default Add New Menu items to the Tools Menu in Outlook 2007

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 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!



  #9  
Old July 23rd 07, 03:40 PM posted to microsoft.public.outlook.program_forms
Rudy
external usenet poster
 
Posts: 10
Default Add New Menu items to the Tools Menu in Outlook 2007

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 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!



  #10  
Old July 23rd 07, 03:58 PM posted to microsoft.public.outlook.program_forms
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default Add New Menu items to the Tools Menu in Outlook 2007

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 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!



 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
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


All times are GMT +1. The time now is 03:38 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.