Link to home
Start Free TrialLog in
Avatar of MK15
MK15

asked on

Outlook template - VBA - find string in message

Hi,

How would i search for string in a outlook message? i'm trying to search for "*name".

Sub temp()
    Dim path As String
    path = "C:\Users\username\AppData\Roaming\Microsoft\Templates\temp.oft"
    Set msg = Application.CreateItemFromTemplate(path)
    msg.Display
End Sub

Open in new window


Thanks
Avatar of Rgonzo1971
Rgonzo1971

hI,

pls try

if msg.Body like "*name*" then

Regards
SOLUTION
Avatar of Kimputer
Kimputer

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of MK15

ASKER

Thanks - that worked - how would i go about replacing the string if it was found?

Thanks
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial