Reply
 
Thread Tools Display Modes
  #1   Report Post  
Charles Law
 
Posts: n/a
Default ANS: Using Word Automation to get Heading/Outline Numbers

I have just discovered where it is:

For any paragraph 'p' in the document, the heading number is contained in

p.Range.ListFormat.ListString

I hope someone else will find this useful.

Charles


"Charles Law" wrote in message
...
I have a document in the following style

1 Introduction
2 Next Heading
2.1 Sub-section
Some text ...
2.2 Another Sub-section
2.2.1 Getting deeper
3 Another Major Heading
...

My final aim is to iterate through the document in VB.NET, pick out the
headings and text and create a cleaned-up, normalised XML document.

At the moment, I am iterating through the paragraphs in the document, just
picking out the headings. When I look at the text of the heading it does
not include the heading number (which is fair enough). But, how do I
retrieve the heading number? Each heading is formatted with the
appropriate heading style for its level, so "Introduction" is Heading 1,
"Getting deeper" id Heading 3, and so on.

I could look at the outline level and work it for myself, but I presume
that Word knows what number it is going to give to a heading, and it is
this number I would like to get at.

TIA

Charles




Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Copying a word table into another word document mszingy Microsoft Word Help 1 November 23rd 04 11:15 PM
A Question About the Track Changes function in Word GoneFission Microsoft Word Help 2 November 23rd 04 06:12 PM


All times are GMT +1. The time now is 02:04 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"