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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Outlook Folders and Contact Message Class

Status
Not open for further replies.

jahlmer

Technical User
Aug 23, 2000
143
US
I would like to select the Contacts folder, not the active folder. This must be simple! How?

This script sets the form or "message class" that contacts use. But, if I have inbox selected when I run it, all items in that folder will open in a contact form. Ouch, can't do that.

Thanks in Advance (TIA)

Sub cmdSetForm_Click()

' Change the following line to your new Message Class
NewMC = "IPM.Contact.CustomForm"

Set CurFolder = Application.ActiveExplorer.CurrentFolder
Set AllItems = CurFolder.Items
NumItems = CurFolder.Items.Count

' Loop through all of the items in the folder
For i = 1 To NumItems

Set CurItem = AllItems.Item(i)

' Test to see if the Message Class needs to be changed
If CurItem.MessageClass <> NewMC Then

' Change the Message Class
CurItem.MessageClass = NewMC

' Save the changed item
CurItem.Save

End If

Next

MsgBox &quot;All Contacts using new Form.&quot;

End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top