![]() |
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
![]()
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 |
#2
|
|||
|
|||
![]() Sub FixHyperlink(MyMail As MailItem) Dim strID As String Dim objMail As Outlook.MailItem Dim strText As String strID = MyMail.EntryID Set objMail = Application.Session.GetItemFromID(strID) strText = objMail.Body strText = Replace(strText, "]]", "%5D%5D") objMail.Body = strText objMail.Save Set objMail = Nothing End Sub -- Best regards Michael Bauer - MVP Outlook : Outlook Categories? Category Manager Is Your Tool : VBOffice Reporter for Data Analysis & Reporting : http://www.vboffice.net/product.html?pub=6&lang=en Am Fri, 21 Nov 2008 12:09:50 -0600 schrieb RogerM: 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 |
#3
|
|||
|
|||
![]()
Thanks Michael
~Roger "Michael Bauer [MVP - Outlook]" wrote in message ... Sub FixHyperlink(MyMail As MailItem) Dim strID As String Dim objMail As Outlook.MailItem Dim strText As String strID = MyMail.EntryID Set objMail = Application.Session.GetItemFromID(strID) strText = objMail.Body strText = Replace(strText, "]]", "%5D%5D") objMail.Body = strText objMail.Save Set objMail = Nothing End Sub -- Best regards Michael Bauer - MVP Outlook : Outlook Categories? Category Manager Is Your Tool : VBOffice Reporter for Data Analysis & Reporting : http://www.vboffice.net/product.html?pub=6&lang=en Am Fri, 21 Nov 2008 12:09:50 -0600 schrieb RogerM: 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 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
How can I do a global text replace for all contacts? | Mike | Outlook - Using Contacts | 3 | April 23rd 08 12:01 AM |
Associate contact and read receipt rule | [email protected] | Outlook - General Queries | 1 | August 24th 07 05:59 PM |
Rule to auto reply using a dynamic text file as attachment or message body | DF | Outlook - General Queries | 0 | June 29th 07 07:38 PM |
Search & Replace Text in the Body of a Message | dch3 | Outlook and VBA | 1 | June 7th 07 04:45 AM |
Read receipt Setting via Rule | John | Outlook - General Queries | 1 | May 11th 06 04:50 PM |