Silversonic
New Member
- OS Version(s)
- Windows
- Outlook version
- Outlook 365 32 bit
Operating system:: Win 11
Outlook version: OUtlook 365 Classic
Email type or host: Exchange
Outlook version: OUtlook 365 Classic
Email type or host: Exchange
System is Win 11, Outlook 365 32 bit classic, Exchange server. During some recent Outlook housekeeping when I was trying to change to a custom form for contacts, about 400 emails somehow managed to get their message class changed from the standard IPM.note as well and converted to contacts. I'd like to retrieve these emails for archive purposes. Have moved all affected into a single subfolder, and have discovered that if I use MFCMAPI on that folder, I can convert each item individually from the erroneous 'IPM.Contact.TN Contacts 20250531' back to 'IPM.Note' and see the email again in its original form. Clearly can't make bulk changes with MFCMAPI so thought I'd try a VBA macro on only the subfolder that contains the affected items and loaded an amended version of one that I found on Slipstick, but can't get it to run (macros & VBA enabled and can see VBA menus etc). But it doesn't run/doesn't work, and can't see what the issue is given that message class change individually with MFCMAPI works. Is it a syntax error or something else- help gratefully received and still regretting the demise of MessageClassModifier that worked to well up to Outlook 2007:
Sub ChangeMessageClass()
Set olNS = Application.GetNamespace("MAPI")
Set ContactsFolder = Application.ActiveExplorer.CurrentFolder
Set ContactItems = ContactsFolder.Items
For Each Itm In ContactItems
If Itm.MessageClass <> "IPM.Contact.TN Contacts 20250531" Then
Itm.MessageClass = "IPM.Note"
Itm.Save
End If
Next
End Sub
Many thanks in advance!
Sub ChangeMessageClass()
Set olNS = Application.GetNamespace("MAPI")
Set ContactsFolder = Application.ActiveExplorer.CurrentFolder
Set ContactItems = ContactsFolder.Items
For Each Itm In ContactItems
If Itm.MessageClass <> "IPM.Contact.TN Contacts 20250531" Then
Itm.MessageClass = "IPM.Note"
Itm.Save
End If
Next
End Sub
Many thanks in advance!