Find by OutlineLevel

J

James

Hi

I'm trying to use:

With rngDocument.Find
.Text = ""
.ParagraphFormat.OutlineLevel = wdOutlineLevel2
.Execute
End With

....but finds that it turns up "false negatives" in some documents (ie there
are "Heading 2" style paragraphs that don't get picked up).

Checking the document through the GUI, the OutlineLevel box does appear
greyed out. You can fix it by moving the cursor to the end of the document
then searching forward, but this fix doesn't seem to work if you do the
equivalent through VBA.

This only happens on certain documents, so I guess it could be a corruption
issue, but has anyone come across anything similar? Searching by style name
works, but I'd rather not depend on the style name, if at all possible.

Thanks
 

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