Customizing toolbar OL 2007

dasadler
5StarLounger
Posts: 889
Joined: 25 Jan 2010, 16:26
Location: Garden Grove, CA 92844 USA

Customizing toolbar OL 2007

Post by dasadler »

I have some Outlook templates I use and it is cumbersome to invoke them... I have to use the dialog boxes as shown below. I thought I might be able to do a macro and assign it to a command button on the tool bar - or to a new menu item but I cannot find any way in OL to do this. Ideally, I would like to have a menu where I could list my templates (or several buttons) and quickly click on one to create a new message with my selected template.

I did customize the tool bar as much as I could by putting the form chooser button but it brings up what you see below.
You do not have the required permissions to view the files attached to this post.
Don

User avatar
HansV
Administrator
Posts: 78826
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Customizing toolbar OL 2007

Post by HansV »

You could create a series of macros like this:

Code: Select all

Sub UseTemplate1()
  Application.CreateItemFromTemplate TemplatePath:="C:\Templates\Template1.oft"
End Sub
In the Customize dialog, add a new menu to the Outlook menu bar or to a toolbar, and add the macros to the new menu.
Best wishes,
Hans

dasadler
5StarLounger
Posts: 889
Joined: 25 Jan 2010, 16:26
Location: Garden Grove, CA 92844 USA

Re: Customizing toolbar OL 2007

Post by dasadler »

Would i do that by doing Alt-F11? If so, would it be a 'module'?
Don

User avatar
HansV
Administrator
Posts: 78826
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Customizing toolbar OL 2007

Post by HansV »

Yes, press Alt+F11 to activate the Visual Basic Editor.
Then select Insert | Module to create a new module in which you can create the macros.
Best wishes,
Hans

dasadler
5StarLounger
Posts: 889
Joined: 25 Jan 2010, 16:26
Location: Garden Grove, CA 92844 USA

Re: Customizing toolbar OL 2007

Post by dasadler »

Thank you Hans, I did this as you suggested and have a couple of observations: (see the line of code below)

1) If the macro name on the button does not match the actual sub name in code, I get an error - this means I must have a cryptic name like Project1.EventInfo on the button image on the toolbar when I would like a more friendly name.

2) When the names are correct, I get no error but nothing happens.

Finally, I used customize toolbar to create a new menu group but cannot get the macro into the menu - is this possible?






Sub EventInfo()
Application.CreateItemFromTemplate TemplatePath:="C:\Users\Don\AppData\Roaming\Microsoft\Templates\event info.oft"
End Sub
Don

dasadler
5StarLounger
Posts: 889
Joined: 25 Jan 2010, 16:26
Location: Garden Grove, CA 92844 USA

Re: Customizing toolbar OL 2007

Post by dasadler »

I think I fixed # 2 above by using the following code (found on the MS site):

Sub EventInfo()
Dim MyItem As Outlook.MailItem
Set MyItem = Application.CreateItemFromTemplate("C:\Users\Don\AppData\Roaming\Microsoft\Templates\event info.oft")
MyItem.Display
End Sub

However... any way to have a more friendly name for the macro displayed? Ideally as one of several templates within a menu list.
Don

User avatar
HansV
Administrator
Posts: 78826
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Customizing toolbar OL 2007

Post by HansV »

To add a new menu to the menu bar or to a toolbar, add the New Menu item to it:
x.png
Right-click the new menu that you created and change its name in the Name box (*).
Next, select the Macros category, and drag a macro to the new menu; when the menu drops down, move the mouse to the (initially empty) menu and drop the macro.
Right-click the new menu item and change its name in the Name box (*).
x73.png
Repeat as needed.
Close the Customize dialog when done.

(*) If you want to underline a letter in the menu or item name, precede it with an ampersand &.
If you want to include an ampersand in the name, use two ampersands &&.
You do not have the required permissions to view the files attached to this post.
Best wishes,
Hans

dasadler
5StarLounger
Posts: 889
Joined: 25 Jan 2010, 16:26
Location: Garden Grove, CA 92844 USA

Re: Customizing toolbar OL 2007

Post by dasadler »

Perfect. Thank you.
Don