> selection.Range.ListFormat.ListString
This will work if the cursor is actually positioned in the heading. if it is
not, then the following should work, provided that headings have been
implemented using the Heading styles
ActiveDocument.Bookmarks("\HeadingLevel").Range. _
Paragraphs(1).Range.ListFormat.ListString
This will get the heading number of the next heading above the current
selection.

Signature
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org
Jezebel - 05 Jul 2005 13:19 GMT
Works for me, Jonathon. Rather surprisingly, perhaps. Try it :)
>> selection.Range.ListFormat.ListString
>
[quoted text clipped - 7 lines]
> This will get the heading number of the next heading above the current
> selection.
charlieLWallace - 06 Jul 2005 05:51 GMT
Hi,
Hmmm. This seems to work only when I'm at heading level one - otherwise
returns blank! Here's how I implemented your suggestion: The MsgBox line is
split below, but is all one line in my macro.
Sub genBookmarkList()
MsgBox
ActiveDocument.Bookmarks("\HeadingLevel").Range.Paragraphs(1).Range.ListFormat.ListString
Exit Sub
When I run this macro with the cursor in the text or heading of my section
14, it returns "14.", but when I put the cursor in the text or heading of
section 14.2, I get nothing. I was hoping to get "14.1" or "14.1.".
Suggestions?
Thanks for your help!!!!!!!!!!!!!!
-- Charlie
> > selection.Range.ListFormat.ListString
>
[quoted text clipped - 7 lines]
> This will get the heading number of the next heading above the current
> selection.