I created a VBA script in Outlook 2010 but the only way it will run is by clicking on the play button while in Outlook VBA as indicated in the image below:
Why won't it run when I select the VBA script from the menu as indicated in the image below? I have already signed the VBA script by using "SelfCert.exe".
The other two VBA scripts in the list do run when they are selected from the menu. Below is the code of the VBA script that does not run:
Sub ReplaceIPs()
Dim Insp As Inspector
Dim obj As Object
Set Insp = Application.ActiveInspector
Set obj = Insp.CurrentItem
obj.HTMLBody = Replace(obj.HTMLBody, "192.168.1", "255.255.255")
Set obj = Nothing
Set Insp = Nothing
End Sub
The above VBA script is supposed to find and replace all instances of "192.168.1" with "255.255.255" in the body of the email that is being composed.