PC Review
Forums
Newsgroups
Microsoft Outlook
Microsoft Outlook VBA Programming
Custom Contact Form Questions
Forums
Newsgroups
Microsoft Outlook
Microsoft Outlook VBA Programming
Custom Contact Form Questions
![]() |
Custom Contact Form Questions |
|
|
Thread Tools | Rate Thread |
|
|
#1 |
|
Guest
Posts: n/a
|
Hi,
I have created a custom contact form and am trying to set it as the default for certain contact folders. When I insert a new contact it opens up my custom form, but when I double click on a contact I get the default contact form from Outlook. Is there a way to always open up the custom form either when adding or viewing the contacts in that folder? I add the contact folders using VFP code. Is there a way to default the folder to use the custom contact form from code? If not how do I set the custom contact form as the default for all contact folders. loOutlook = CREATEOBJECT("Outlook.Application") *Get the MAPI namespace and find the contacts folder loNamespace = loOutlook.GetNameSpace("MAPI") *get the folder location to save the contacts loFolder = loNameSpace.PickFolder loFolder.folders.Add(tcFolder,olFolderContacts) Thank you. |
|
|
|
#2 |
|
Guest
Posts: n/a
|
Try this:
Sub ChangeMessageClass() Set olApp = New Outlook.Application Set olNS = olApp.GetNameSpace("MAPI") Set ContactsFolder = _ olNS.GetDefaultFolder(olFolderContacts) Set ContactItems = ContactsFolder.Items For Each Itm in ContactItems If Itm.MessageClass <> "IPM.Contact.MyForm" Then Itm.MessageClass = "IPM.Contact.MyForm" Itm.Save End If Next End Sub This works only when your ContactItem is in the default folder. Otherwise you have to use the folder-list to get your specific folder. with kind regards Helmut Sempf <tguenther@hotmail.com> schrieb im Newsbeitrag news:1109608930.659491.103700@g14g2000cwa.googlegroups.com... > Hi, > > I have created a custom contact form and am trying to set it as the > default for certain contact folders. When I insert a new contact it > opens up my custom form, but when I double click on a contact I get the > default contact form from Outlook. Is there a way to always open up the > custom form either when adding or viewing the contacts in that folder? > > I add the contact folders using VFP code. Is there a way to default the > folder to use the custom contact form from code? If not how do I set > the custom contact form as the default for all contact folders. > > loOutlook = CREATEOBJECT("Outlook.Application") > *Get the MAPI namespace and find the contacts folder > loNamespace = loOutlook.GetNameSpace("MAPI") > > *get the folder location to save the contacts > loFolder = loNameSpace.PickFolder > > loFolder.folders.Add(tcFolder,olFolderContacts) > > Thank you. > |
|
|
|
#3 |
|
Guest
Posts: n/a
|
This code changes the message class for existing items, which is not what
the original poster was asking. They wanted to know how to set the message class for a folder. That's done with CDO 1.21 using the PR_DEF_POST_MSGCLASS (0x36E5001E) and PR_DEF_POST_DISPLAYNAME (0x36E6001E) properties. See http://www.cdolive.com/cdo10.htm if you're not familiar with MAPI property tags. To make a custom form the default for all contacts requires a registry change. See http://www.outlookcode.com/d/newdef...m#changedefault . -- Sue Mosher, Outlook MVP Author of Microsoft Outlook Programming - Jumpstart for Administrators, Power Users, and Developers http://www.outlookcode.com/jumpstart.aspx "Helmut Sempf" <info@sempf.de> wrote in message news:4223f4ca$0$921$afc38c87@news.easynet.de... > Try this: > > Sub ChangeMessageClass() > Set olApp = New Outlook.Application > Set olNS = olApp.GetNameSpace("MAPI") > Set ContactsFolder = _ > olNS.GetDefaultFolder(olFolderContacts) > Set ContactItems = ContactsFolder.Items > For Each Itm in ContactItems > If Itm.MessageClass <> "IPM.Contact.MyForm" Then > Itm.MessageClass = "IPM.Contact.MyForm" > Itm.Save > End If > Next > End Sub > > This works only when your ContactItem is in the default folder. Otherwise > you > have to use the folder-list to get your specific folder. > > > with kind regards > > Helmut Sempf > > > <tguenther@hotmail.com> schrieb im Newsbeitrag > news:1109608930.659491.103700@g14g2000cwa.googlegroups.com... >> Hi, >> >> I have created a custom contact form and am trying to set it as the >> default for certain contact folders. When I insert a new contact it >> opens up my custom form, but when I double click on a contact I get the >> default contact form from Outlook. Is there a way to always open up the >> custom form either when adding or viewing the contacts in that folder? >> >> I add the contact folders using VFP code. Is there a way to default the >> folder to use the custom contact form from code? If not how do I set >> the custom contact form as the default for all contact folders. >> >> loOutlook = CREATEOBJECT("Outlook.Application") >> *Get the MAPI namespace and find the contacts folder >> loNamespace = loOutlook.GetNameSpace("MAPI") >> >> *get the folder location to save the contacts >> loFolder = loNameSpace.PickFolder >> >> loFolder.folders.Add(tcFolder,olFolderContacts) >> >> Thank you. >> > > |
|
|
|
#4 |
|
Guest
Posts: n/a
|
Hi Sue,
thanx for correcting that! Helmut Sempf, Outlook novice Reader of Microsoft Outlook Programming - Jumpstart for Administrators, Power Users, and Developers http://www.outlookcode.com/jumpstart.aspx |
|
|
|
#5 |
|
Guest
Posts: n/a
|
No problem! It's easy to get confused by all the different concepts of
default forms. I know it took me a while to sort it out in my little brain. BTW, thanks for the chuckle. -- Sue Mosher, Outlook MVP Frustrated author of Configuring Microsoft Outlook 2003 to be published when I finally get it finished. "Helmut Sempf" <info@sempf.de> wrote in message news:4224dfba$0$16491$afc38c87@news.easynet.de... > Hi Sue, > > thanx for correcting that! > > Helmut Sempf, Outlook novice > Reader of > Microsoft Outlook Programming - Jumpstart for > Administrators, Power Users, and Developers > http://www.outlookcode.com/jumpstart.aspx > > > > |
|
![]() |
|
| Thread Tools | |
| Rate This Thread | |
|
|

Main Page 

