Link to home
Start Free TrialLog in
Avatar of rogerdjr
rogerdjrFlag for United States of America

asked on

Outlook 2013 Macro - Find Text String in Outlook Contact Body and delete the string

I am looking for a way to remove an unwanted text string in the Notes (Body) section of outlook contacts

I have a vba macro that pages through all contacts and tried to use this code but it isn't working can anybody help?

                If InStr(1, .Body, "Facility Condition Assessment EBlast 09-03-2014 Test Run 01") > 0 Then
                    .Body = Replace(.Body, "==============^pFacility Condition Assessment EBlast 09-03-2014 Test Run 01", "")
                    BodyUpdtCnt = BodyUpdtCnt + 1
                End If

Thanks
Avatar of Calvin Paxson
Calvin Paxson

Export the contacts to csv, open with excel, use find replace to replace with unwanted string with nothing, import contacts back.  This may be far easier than troubleshooting your vba macro and should work very well.
Avatar of David Lee
Hi, rogerdjr.

Add .Save on the line after the Replace.
Avatar of rogerdjr

ASKER

Bluedevilfan

I did have .save just after the code snippet I sent


As for the csv option - I guess it would work, but not the solution I was hoping for thanks
If you are doing this once than the CSV option may be less work however if you need to repeat the process against 10 or more address books doing it programatically would potentially save some time.  The more address books involved the better the macro starts to look.
ASKER CERTIFIED SOLUTION
Avatar of David Lee
David Lee
Flag of United States of America image

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
I'll test it over the weekend
I've requested that this question be closed as follows:

Accepted answer: 0 points for rogerdjr's comment #a40344040

for the following reason:

Thanks - works perfectly - sorry it took so long to test