I've designed a custom Outlook contact form which works fine whenever I add a new contact, but existing contacts are still displayed on the old form. (What an aggravation!)
I'd like to display both old and new contacts using the current custom form.
MS/Outlook help suggests the following change, but if this is VB application code, I'm not sure where to insert the code. Does it go inside the contact template? If so, WHERE should I insert it and HOW? (I'm not familar w/ VB script, and would prefer to use VB for apps. if possible.) Can someone pls. help?
____________________________________________________
MS/Outlook/Help says:
The Message Class field cannot be directly changed using the Outlook user interface, but you can use VBScript, Visual Basic, or Visual Basic for Applications to change the Message Class field.
The following Automation code can be used as a basis for developing your own solution. This code assumes that the name of the new form is MyForm. It will change all contacts in your default contacts folder so that they will use MyForm.
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
_____________________________________________________
I would also prefer the new form to be utilized whenever I import a new contact datafile into the folder. Right now, even though I have a new form designated, during an import of a new contact file, MS/Outlook imports everything into the old template. (Wonder why they designed it to do that? Maybe they just want to discourage use of a custom form?)
Any help would be appreciated.
Thanks in advance.
Regards,
Rob
I'd like to display both old and new contacts using the current custom form.
MS/Outlook help suggests the following change, but if this is VB application code, I'm not sure where to insert the code. Does it go inside the contact template? If so, WHERE should I insert it and HOW? (I'm not familar w/ VB script, and would prefer to use VB for apps. if possible.) Can someone pls. help?
____________________________________________________
MS/Outlook/Help says:
The Message Class field cannot be directly changed using the Outlook user interface, but you can use VBScript, Visual Basic, or Visual Basic for Applications to change the Message Class field.
The following Automation code can be used as a basis for developing your own solution. This code assumes that the name of the new form is MyForm. It will change all contacts in your default contacts folder so that they will use MyForm.
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
_____________________________________________________
I would also prefer the new form to be utilized whenever I import a new contact datafile into the folder. Right now, even though I have a new form designated, during an import of a new contact file, MS/Outlook imports everything into the old template. (Wonder why they designed it to do that? Maybe they just want to discourage use of a custom form?)
Any help would be appreciated.
Thanks in advance.
Regards,
Rob