View Single Post
  #2  
Old March 4th 06, 05:15 PM posted to microsoft.public.outlook.program_forms
Hollis D. Paul
external usenet poster
 
Posts: 66
Default VBA shortcut to open custom form in design mode?

In article , Burma Jones wrote:
There is a custom form that I modify frequently and I was wondering
if there is any way to programmatically open the form in design
mode? Currently I have to go Tools - Forms - Design a Form -
Personal Forms Library - select the form (or double-click) - Open

Well, you can certainly write VBA code to open the form. That would
get half the process done.

Sub SharePointTips()
'Declarations
Dim myItem As ContactItem
Dim myMailItem As MailMessage
Dim myRecip As Recipient
Dim myOlApp As New Outlook.Application
Dim myOlNS As NameSpace
Dim myOlfldr As MAPIFolder
Dim myOlExp As Outlook.Explorer

Set myOlExp = myOlApp.ActiveExplorer
Set myOlNS = myOlApp.GetNamespace("MAPI")
Set myOlfldr = myOlNS.GetDefaultFolder(olFolderContacts)

Set myItem = myOlfldr.Items.Add("IPM.Contact.SharePointTips_Q")
myItem.Display

Set myRecip = Nothing
Set myMailItem = Nothing


'free variables
Set myItem = Nothing
Set myOlNS = Nothing
Set myOlfldr = Nothing
Set myOlApp = Nothing
Set myOlExp = Nothing

End Sub


Put it in the ThisOutlook module. Change the names to reflect your
system.

Hollis D. Paul [MVP - Outlook]
Mukilteo, WA USA



Ads
 

Football Forum - Web Advertising - Virgin Wallpaper - Credit Card - Ringtones