troubleshooting Question

VBA code that loops through a document to find defined text in a text string, go to the end of that text string, and insert a character (~) before/after the next paragraph mark

Avatar of Jeff McClellan
Jeff McClellanFlag for United States of America asked on
Microsoft WordVBA
2 Comments1 Solution231 ViewsLast Modified:
I want to use VBA / Word macro that will add a "~" character (or some unique symbol) at the end of every line where "http://" occurs and before/after the next line break/paragraph mark.  

1.  Search for an instance of the search text.  In this case "http://"
2. Find the next paragraph mark (line break) immediately after the search text.
3. Insert a "~" character immediately before (or after) the paragraph mark (line break).

Here is an example of the text I want to apply that to:

Ag Analytical Services Lab
• Soil Program 4x Year
Spargo, John T.
University Park, PA, 16802
Tel: 814-863-0841
Fax: 814-863-4540
AGAT Laboratories - Burnaby
• Soil and Plant Program
Pahl, Mackenzie
Burnaby, BC, V5J 0B6
Tel: 778-452-4000
Fax: 778-452-4074
AGAT Laboratories - Mississauga
• Soil and Plant Program 2x Year
Boulton, Nick
Mississauga, ON, L4Z 1Y2
Tel: 905-712-5075
Fax: 905-501-0589
AgLab Express
• Soil and Plant Program
Barber, Michael
Sioux Falls, SD, 57105-6411
Tel: 605-271-9237
Fax: 605-271-9238
Paul Cook-Giles
Senior Application Developer

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 2 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros