Endless- loop in find sequenz

P

Paul Haboeck

Hallo

I use the following VB code for to go over through all sections of a
document.


With ActiveDocument.Content.Find
.ClearFormatting
.Text = ""
.Format = True
.Style = intHead_Type
.Forward = True
.Wrap = wdFindStop
While .Found = True

Set oRng = .Parent
MsgBox oRng.Text

.Execute
Wend
End With


I receive thereby all heading texts, but the loop is never terminated. The
last heading comes endlessly.

What can the cause for this problem be?

Thank you for assistance and suggestions...

Paul
 

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