Outlook 2010 Search and delete part of a link inside HTML body message

Hanan

New Member
Outlook version
Outlook 2010 64 bit
Email Account
Exchange Server 2010
I am trying to create a rule to delete part of a link inside an HTML Email message.
The body of the message source code is:

<html><body><style></style> <p style='margin:0cm' dir=rtl bgcolor='#ffffff'><font face='Arial' size='2'> Order <a href = "priority:priform#PORDERS:pO16004270:genigar:C:\Users\hanan\WINDOWS\tabula.ini" ><span dir='ltr'>PO16004270</span></a> </font></p> </body></html>

I have to delete this part: "C:\Users\hanan\WINDOWS\"
out of it.

How can I do that. tried so many codes with no sucsses.
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
The method at How to Change the Font used for Outlook's RSS Feeds should work - instead of changing fonts, you'll replace that phrase with "".
NewFont = C:\Users\hanan\WINDOWS\"
OldFont = ""

That works from a rule (change PostItem to mailitem to use in a rule). To apply it to a selected message, you can use a little stub macro that calls that macro - then select the message and run this stub. It'll bring up the macro that actually does the work.

Code:
Sub StubMacro()
Dim olMail as Mailitem
Set olMail = Application.ActiveExplorer.Selection.Item(1)
   ChangeRSSFont olMail 
Set OlMail = Nothing
End Sub
you can change the variables names and the macro name so it makes more sense - just make sure you change all instances.
 

Hanan

New Member
Outlook version
Outlook 2010 64 bit
Email Account
Exchange Server 2010
The method at How to Change the Font used for Outlook's RSS Feeds should work - instead of changing fonts, you'll replace that phrase with "".
NewFont = C:\Users\hanan\WINDOWS\"
OldFont = ""

That works from a rule (change PostItem to mailitem to use in a rule). To apply it to a selected message, you can use a little stub macro that calls that macro - then select the message and run this stub. It'll bring up the macro that actually does the work.

Code:
Sub StubMacro()
Dim olMail as Mailitem
Set olMail = Application.ActiveExplorer.Selection.Item(1)
   ChangeRSSFont olMail
Set OlMail = Nothing
End Sub
you can change the variables names and the macro name so it makes more sense - just make sure you change all instances.
Thank you. Works like charm. Just a small fix for your Stub Macro, I had to set the complete pathe to the script. See below:

Code:
Sub StubMacro()

 Dim olMail As MailItem
 Set olMail = Application.ActiveExplorer.Selection.Item(1)
 Project1.ThisOutlookSession.ChangeTabula olMail
 Set olMail = Nothing
 
End Sub
 

Similar threads

Top