View Single Post
  #1  
Old November 21st 08, 07:09 PM posted to microsoft.public.outlook.program_vba
RogerM[_2_]
external usenet poster
 
Posts: 5
Default How to replace text upon receipt of message using a Rule?

I'm trying to run a sript that will execute when an email message arrives
that will replace ]] with %5D%5D. I've tried the code below, but keep keep
getting an error that a user-defined type isn't defined. Maybe the code
below isn't even close for what I'm trying to accomplish, I don't know.
Any assistance would be appreciated. ~ Roger

Sub FixHyperlink(MyMail As MailItem)
Dim strID As String
Dim objMail As Outlook.MailItem
Dim strText As Object

strID = MyMail.EntryID
Set objMail = Application.Session.GetItemFromID(strID)
strText = objMail.Body

With objMail.Body
strText = Replace(strText, "]]", "%5D%5D")
End With

objMail.Save

Set objMail = Nothing

End Sub


Ads