I am writing a small Outlook Macro via the Outlook 2013 VBA to open a .msg file and replace our old sharepoint links with our new share point links. The problem that i am having is that when i run this, It seems to do what i want it too except that it gets rid of all the formating in the email. Is there a way to fix this? It seems like the default is in Rich Text.
My VBA so far is:
Dim MyItem As Outlook.MailItem
Set MyItem = Application.CreateItemFromTemplate("C:\Users\502402087\Desktop\outlooktest.msg")
Dim bodyRep As String
Dim oldstr As String
Dim newstr As String
oldstr = "gensuitellccom-1.sharepoint.microsoftonline.com"
newstr = "gensuite-portal1.sharepoint.com"
bodyRep = MyItem.body
bodyRep = Replace(bodyRep, oldstr, newstr)
MyItem.body = bodyRep