在VBA中,如何在“当前”选择中获得标题编号?

Snh*_*hp9 2 vba word-vba

我已经尝试了所有可以找到的内容,只是获得了Microsoft Word中Selection的标题编号。

我试过了

Selection.HomeKey wdline, wdExtend
Selection.Expand wdline
Selection.HomeKey wdParagraph, wdExtend
ect. Simular stuff.
Run Code Online (Sandbox Code Playgroud)

标题示例。

4.2.3     This is a heading
Run Code Online (Sandbox Code Playgroud)

我尝试的所有操作都只给我标题中的文字,而不是数字

我要它回来

4.2.3
Run Code Online (Sandbox Code Playgroud)

我无法将“文档编号”转换为“文本”,因为它会弄乱空格。

Snh*_*hp9 6

我已经通过使用解决了我的问题。

Selection.Paragraphs(1).Range.ListFormat.ListString
Run Code Online (Sandbox Code Playgroud)

这只给了我数字。

为什么标题是段落???我只是不知道