Get the heading number at my Current selection

ms-word, vba

Solution

I have solved my issue by using.

Selection.Paragraphs(1).Range.ListFormat.ListString

This gave me just the number.

Why a heading is a Paragraph??? I just don't know.

Problem

I have tried Everything I could find to get just the heading number for the Selection in Microsoft Word. What I tried. ``` Selection.HomeKey wdline, wdExtend Selection.Expand wdline Selection.HomeKey wdParagraph, wdExtend ect. Simular stuff. ``` Example of the heading. ``` 4.2.3 This is a heading ``` Everything I try just gives me the text in the heading and not the number I want it to return ``` 4.2.3 ``` I cant convert the Documents Number to Text because it will mess with the spacing.

Original source