Good afternoon,
I created the script below to check in Outlook the incoming mail (it's to remark potential URL with spyware). That script works if I run it manually but I don't know how to change it as to make it working as a Rule. Can you kindly give me the details to make it as Rule?
I want to create a rule in Outlook to run that Script with any new incoming message.
Sub RemoveExpression()
Dim outApp As Object
Dim outInsp As Object
Dim outObj As Object
Dim strTextToReplace As String
Set outApp = GetObject(, "Outlook.Application")
Set outInsp = outApp.ActiveInspector
Set outObj = outInsp.CurrentItem
strTextToReplace = "/index.php"
strTextToReplace2 = "/default.php"
strTextToReplace3 = ".exe"
strTextToReplace4 = ".com"
outObj.Body = Replace(outObj.Body, strTextToReplace, "/index.p h p")
outObj.Body = Replace(outObj.Body, strTextToReplace2, "/default.p h p")
outObj.Body = Replace(outObj.Body, strTextToReplace3, ".e x e")
outObj.Body = Replace(outObj.Body, strTextToReplace4, ".c o m")
Set outObj = Nothing
Set outInsp = Nothing
Set outApp = Nothing
End Sub
Thanks for your support
I created the script below to check in Outlook the incoming mail (it's to remark potential URL with spyware). That script works if I run it manually but I don't know how to change it as to make it working as a Rule. Can you kindly give me the details to make it as Rule?
I want to create a rule in Outlook to run that Script with any new incoming message.
Sub RemoveExpression()
Dim outApp As Object
Dim outInsp As Object
Dim outObj As Object
Dim strTextToReplace As String
Set outApp = GetObject(, "Outlook.Application")
Set outInsp = outApp.ActiveInspector
Set outObj = outInsp.CurrentItem
strTextToReplace = "/index.php"
strTextToReplace2 = "/default.php"
strTextToReplace3 = ".exe"
strTextToReplace4 = ".com"
outObj.Body = Replace(outObj.Body, strTextToReplace, "/index.p h p")
outObj.Body = Replace(outObj.Body, strTextToReplace2, "/default.p h p")
outObj.Body = Replace(outObj.Body, strTextToReplace3, ".e x e")
outObj.Body = Replace(outObj.Body, strTextToReplace4, ".c o m")
Set outObj = Nothing
Set outInsp = Nothing
Set outApp = Nothing
End Sub
Thanks for your support