S
Shauna Koppang
I am trying to modify a macro to pull a custom Contact
Form from my Personal Forms Library called "Change File As
Fields", that I will activate using a new tool on my
toolbar.
This code I originally found through Microsoft
Knowledgebase.
To manually run the form I am in Contacts, then choose
File menu, New, Choose Custom Form, then choose Personal
Forms Library, then the form Change File As Fields, and
click OK.
When I run the macro as it stands it brings up New Mail
Message not my custom form. Can anyone help me change my
code to pull up my custom form? THANKS!!!
Shauna
Sub RunMyForm()
Dim myOlApp As Application
Dim myNameSpace As NameSpace
Dim myFolder As MAPIFolder
Dim myItems As Items
Dim myItem As Object
Set myOlApp = CreateObject("Outlook.Application")
Set myNameSpace = myOlApp.GetNamespace("MAPI")
Set myFolder = _
myNameSpace.GetDefaultFolder(olFolderContacts)
Set myItems = myFolder.Items
Set myItem = myItems.Add
("IPM.Contacts.Change_File_As_Fields")
myItem.Display
Set myOlApp = Nothing
Set myNameSpace = Nothing
Set myFolder = Nothing
Set myItems = Nothing
Set myItem = Nothing
End Sub
Form from my Personal Forms Library called "Change File As
Fields", that I will activate using a new tool on my
toolbar.
This code I originally found through Microsoft
Knowledgebase.
To manually run the form I am in Contacts, then choose
File menu, New, Choose Custom Form, then choose Personal
Forms Library, then the form Change File As Fields, and
click OK.
When I run the macro as it stands it brings up New Mail
Message not my custom form. Can anyone help me change my
code to pull up my custom form? THANKS!!!
Shauna
Sub RunMyForm()
Dim myOlApp As Application
Dim myNameSpace As NameSpace
Dim myFolder As MAPIFolder
Dim myItems As Items
Dim myItem As Object
Set myOlApp = CreateObject("Outlook.Application")
Set myNameSpace = myOlApp.GetNamespace("MAPI")
Set myFolder = _
myNameSpace.GetDefaultFolder(olFolderContacts)
Set myItems = myFolder.Items
Set myItem = myItems.Add
("IPM.Contacts.Change_File_As_Fields")
myItem.Display
Set myOlApp = Nothing
Set myNameSpace = Nothing
Set myFolder = Nothing
Set myItems = Nothing
Set myItem = Nothing
End Sub