Hi,
I am trying to use the following macro to automatically convert emails that aren't in Rich Text to Rich Text when they arrive in Outlook:
Dim WithEvents olkInboxItems As Outlook.Items
Private Sub Application_Quit()
Set olkInboxItems = Nothing
End Sub
Private Sub Application_Startup()
Set olkInboxItems = Session.GetDefaultFolder(olFolderInbox).Items
End Sub
Private Sub olkInboxItems_ItemAdd(ByVal Item As Object)
If Item.Class = olMail Then
If Item.BodyFormat <> olFormatRichText Then
Item.BodyFormat = olFormatRichText
Item.Save
End If
End If
End Sub
This doesn't work for some reason however I change the last bit to :
If Item.BodyFormat <> olFormatHTML Then
Item.BodyFormat = olFormatHTML
Item.Save
End If
Then it means all emails that aren't HTML get converted to HTML. Basically the problem is why it's not recognising olFormatRichText.
Any ideas?
Thanks very much
Ed
I am trying to use the following macro to automatically convert emails that aren't in Rich Text to Rich Text when they arrive in Outlook:
Dim WithEvents olkInboxItems As Outlook.Items
Private Sub Application_Quit()
Set olkInboxItems = Nothing
End Sub
Private Sub Application_Startup()
Set olkInboxItems = Session.GetDefaultFolder(olFolderInbox).Items
End Sub
Private Sub olkInboxItems_ItemAdd(ByVal Item As Object)
If Item.Class = olMail Then
If Item.BodyFormat <> olFormatRichText Then
Item.BodyFormat = olFormatRichText
Item.Save
End If
End If
End Sub
This doesn't work for some reason however I change the last bit to :
If Item.BodyFormat <> olFormatHTML Then
Item.BodyFormat = olFormatHTML
Item.Save
End If
Then it means all emails that aren't HTML get converted to HTML. Basically the problem is why it's not recognising olFormatRichText.
Any ideas?
Thanks very much
Ed