?
Solved

List Numbers in Word Documents, extracting them in VB.NET

Posted on 2012-03-26
2
Medium Priority
?
433 Views
Last Modified: 2012-03-27
in a Word document with a standard numbering list, all of the objects I use to extract info from the document return the text but fail to return the actual numbering.  example:

1.1 abc
1.1.2 def
1.1.3 ghi

i'd like to be able to return "1.1 abc" and "1.1.2 def" but I can only figure out how to return "abc" and "def"

there doesn't seem to be an object or method for this.  i've tried Paragraphs and Lists and ListFormat, but haven't succeeded with any of those.
0
Comment
Question by:RBECKMN
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 42

Accepted Solution

by:
dlmille earned 2000 total points
ID: 37769637
You'll have to go through the .Paragraphs collection looking for those paragraphs with a .ListFormat and read the .ListString.

The syntax is something like:  ActiveDocument.Paragraphs(n).Range.ListFormat.ListString.

or something I just tested, like:

Sub checkDocument()
Dim r As Word.Range
Dim p As Word.Paragraph

    For Each p In ActiveDocument.Paragraphs
        Debug.Print p.Range.ListFormat.ListString, p.Range.Text
    Next p
End Sub

Open in new window

0
 

Author Closing Comment

by:RBECKMN
ID: 37770973
works great, thanks.  there is another solution to this problem posted elsewhere that also works, but this one is more direct.,
0

Featured Post

Tutorials alone can't teach real engineering

So we built better training tools.

-Hands-on Labs
-Instructor Mentoring
-Scenario-Based Tests
-Dedicated Cloud Servers

All at your fingertips. What are you waiting for?

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Lync meeting or Lync conferencing is what many organizations would like to deploy to allow them save money. But companies are now giving up for various reasons, one of which is that they cannot join external meetings (non-federated company meetings)…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Viewers will learn how to maximize accessibility options in an Excel workbook for users with accessibility issues.
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question