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

I can't get this code to work in Outlook. Please Help-Look at Line 5

Status
Not open for further replies.

chrisgreen

Programmer
Jun 28, 2000
61
GB
Sub ChangeMessageClass()<br>Set olApp = Application<br>Set olNS = olApp.GetNameSpace(&quot;MAPI&quot;)<br><br>Set ContactsFolder = olNS.GetDefaultFolder(olFolderContacts)<br><br>Set ContactItems = ContactsFolder.Items<br>For Each Itm in ContactItems<br>&nbsp;&nbsp;&nbsp;If Itm.MessageClass &lt;&gt; &quot;IPM.Contact.test1&quot; Then<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Itm.MessageClass = &quot;IPM.Contact.test1&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Itm.Save<br>&nbsp;&nbsp;&nbsp;End If<br>Next<br>End Sub<br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top