PDA

View Full Version : Searching for text and formatting it



timeel39
01-10-2012, 01:12 AM
Hey! I am asking if there was a way (I'm sure there is) for my code to search through my document for a certain string, proceed to select the entire line that text is in, and then format it. And, of course, continue searching for any other instances of the text. Thanks in advance!

macropod
01-10-2012, 07:30 PM
Hi timeel,

Are these 'lines' whole paragraphs, or at least terminated by manual line breaks? If so, a wildcard Find/Replace would probably do the job.

timeel39
01-11-2012, 02:34 PM
They're terminated by manual line breaks. How would a wildcard find/replace work? I know VBA from Excel, so I'm not too savvy on certain Word functions.

macropod
01-11-2012, 03:05 PM
Hi timeel,

For a wildcard Find/Replace, you could use:
Find = [!^l^13]@text to find*[^l^13]
Replace = ^&
and set the replacement formatting to whatever you want.

timeel39
01-11-2012, 07:34 PM
Thanks!