Find special text

E

Elias Kramer

I am looking for a loop that provides all text segments of a document
which follow a special condition (for example Font = Arial). These
segment must be manipulated in some way. The manipulation is not the
problem, but the syntax of the loop.
Is there a simple solution in VBA? An example would help me a great deal.

Elias
 
U

Uniqa

Hi Elias,

try using the Find & replace method for that. To search on a font without
any specific text use: Selection.Find.Font.Name = "Arial"

regards,
 
W

Word Heretic

G'day Elias Kramer <[email protected]>,

Dim Finder as Range

Set Finder = ActiveDocument.Content

With Finder

' use a dot on any following para and you get all the options
available for the find to se

.Execute(Replace:=wdReplaceSomething)
End With

'Finder now has the range required.


More info on www.editorium.com 's back issues.

Steve Hudson - Word Heretic

steve from wordheretic.com (Email replies require payment)
Without prejudice


Elias Kramer reckoned:
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top