Replace existiting contact form

  • Thread starter Thread starter Boris Schwank
  • Start date Start date
B

Boris Schwank

I just created a script to replace the existing contact form, with a
re-designed. Everything workes fine in the standard contact folder, but i
had more contact folders and the there happend nothing.
Can somebody help me?

This is the code I am using,

Sub ChangeMessageClass()
Set olapp = New Outlook.Application
Set olNS = olapp.GetNamespace("MAPI")
Set K1Folder = _ <--This is my Folder-
olNS.GetDefaultFolder(10)
Set ContactsFolder = _
olNS.GetDefaultFolder(10)
Set ContactItems = ContactsFolder.Items
For Each Itm In ContactItems
If Itm.MessageClass <> "IPM.Contact.test" Then
Itm.MessageClass = "IPM.Contact.test"
Itm.Save
End If
Next
Set K1FolderItems = K1Folder.Items
For Each Itm In K1Folder.Items
If Itm.MessageClass <> "IPM.Contact.test" Then
Itm.MessageClass = "IPM.Contact.test"
Itm.Save
End If
Next
End Sub
 
Your code below works only on the main Contacts folder. You would also need
to run it against other folders, either by iterating the folder hierarchy
starting with the Namespace.Folders collection or by viewing each one and
using ActiveExplorer.CurrentFolder or by using the Namespace.PickFolder
method to choose a folder.
 
thx it works!

Sue Mosher said:
Your code below works only on the main Contacts folder. You would also need
to run it against other folders, either by iterating the folder hierarchy
starting with the Namespace.Folders collection or by viewing each one and
using ActiveExplorer.CurrentFolder or by using the Namespace.PickFolder
method to choose a folder.

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
Back
Top