Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I Change form used by existing contacts in Outlook folder?

Status
Not open for further replies.

Vaderik

Programmer
Jan 26, 2003
4
US
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 <> &quot;IPM.Contact.MyForm&quot; Then
Itm.MessageClass = &quot;IPM.Contact.MyForm&quot;
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top