Execute code througout the active document


T

TG

In a document there are a lot of comments, that I want to remove..

Comment ar marked as:

{ This is a comment
and it might include several lines}

I have the code below, that will replace the next {Comment} with a
paragraph (^p)
But how can I have this to run through the entire document (appr.
27000 lines)

With Selection.Find
.Text = "^p{"
.Replacement.Text = "^p"
End With
Selection.Find.Execute
Selection.Extend
With Selection.Find
.Text = "}"
.Replacement.Text = "^p"
End With
Selection.Find.Execute
Selection.TypeParagraph


Kind regards TG
 
Ad

Advertisements


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