Replace existiting contact form


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
 
Ad

Advertisements

S

Sue Mosher [MVP-Outlook]

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.
 
Ad

Advertisements

B

Boris Schwank

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top