View Single Post
  #2  
Old July 25th 08, 01:59 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Button To Open Template - Outlook 2003

If your form has any code in it the form won't run unless it's published.

Otherwise you'd use the ActiveExplorer.CommandBars collection and add a
button to CommandBars("Standard") for adding the button to the Standard
toolbar, to CommandBars("Menu Bar") for a button on the main menu area, etc.

There are lots of examples of adding buttons that way at
www.outlookcode.com. The help in the VBA project for the Object Browser also
has examples for Office.CommandBars, Office.CommandBarButton, etc.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"Andreich71" wrote in message
...
I have a form created in .OFT format.
i want to automatically add a button to the main Outlook window that will
open this form.

I can do it manually - be creating a button with "Edit hyperlink" menu
I also found this script:

Sub MakeItem()
Set newItem = Application.CreateItemFromTemplate("c:\your path\open
test.oft")
newItem.Display
Set newItem = Nothing
End Sub


Ads