Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Outlook / Programming Forms / March 2008

Tip: Looking for answers? Try searching our database.

Add button to Outlook Toolbar to launch specific form

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jim - 19 Mar 2008 18:48 GMT
Hello, I have a mailbox with some custom forms and I'd like to add a button
to the toolbar that would launch a specific form.

Can someone point me in the right direction as to how to accomplish this?

I've added a button to launch the select forms window but they still have to
change folders and select the correct form.  I'm looking to automate this
with just a button click.

Thanks
Jim
Eric Legault [MVP - Outlook] - 19 Mar 2008 19:46 GMT
You can get a reference to the folder in code without selecting it, then
instantiate a specific form and display it using something like:

   Dim objMail As Outlook.MailItem
   Dim objInbox As Outlook.MAPIFolder
   Dim objNS As Outlook.NameSpace
   
   Set objNS = Application.GetNamespace("MAPI")
   Set objInbox = objNS.GetDefaultFolder(olFolderInbox)
   Set objMail = objInbox.Items.Add("IPM.Note.MyCustomFormName")
   objMail.Display
   
   Set objMail = Nothing
   Set objInbox = Nothing
   Set objNS = Nothing

You can access other folders by working through Folders collections in each
folder.  i.e.
objMail.Folders("InboxSubFolder").Folders("InboxSubFolderSubFolder")

Signature

Eric Legault - Outlook MVP, MCDBA, MCTS (SharePoint programming, etc.)
Try Picture Attachments Wizard for Outlook:
http://www.collaborativeinnovations.ca
Blog: http://blogs.officezealot.com/legault/

> Hello, I have a mailbox with some custom forms and I'd like to add a button
> to the toolbar that would launch a specific form.
[quoted text clipped - 7 lines]
> Thanks
> Jim
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.