Put that it a loop. The only problem is that it doesn't give you an obvious
way of knowing when you have reached the end. To check for this, save the
Selection.End property before you do the move, and compare its value after
the move. If no change, then you are at the last heading.
--
Regards
Jonathan West - Word MVP
MultiLinker - Automated generation of hyperlinks in Word
Conversion to PDF & HTML http://www.multilinker.com
What do you mean by "step through"? And what do you want to do with the
heading? For example, you can get the name of each heading by using the
GetCrossReferenceItems method, but if you actually want to modify, say, the
paragraph, then this method might not be the best choice.
I'm running PP 2000 -- I don't see the wdHeading constant
mentioned in the help file anywhere. Actually, I can't
find a reference to that constant at MSDN, either.
I'm running PP 2000 -- I don't see the wdHeading constant
mentioned in the help file anywhere. Actually, I can't
find a reference to that constant at MSDN, either.
Or if you mean the last heading above the current selection:
Dim myRange As Range
Set myRange = Selection.Range.Duplicate
myRange.GoTo What:=wdGoToBookmark, _
Name:="\HeadingLevel"
myRange.Collapse (wdCollapseStart)
MsgBox myRange.Paragraphs(1).Range.Text, _
, myRange.ParagraphFormat.OutlineLevel
Regards,
Klaus
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.