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" <(E-Mail Removed)> wrote in message
news:8649FB6A-E9D7-4EC6-B5C4-(E-Mail Removed)...
>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
>