[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

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

Posted on 2012-03-26
2
Medium Priority
?
443 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

As with any other System Center product, the installation for the Authoring Tool can be quite a pain sometimes. This article serves to help you avoid making these mistakes and hopefully save you a ton of time on troubleshooting :)  Step 1: Make sur…
Many companies are making the switch from Microsoft to Google Apps (https://www.google.com/work/apps/business/). Use this article to learn more about what Google Apps has to offer and to help if you’re planning on migrating to Google Apps. It is …
Viewers will learn how to maximize accessibility options in an Excel workbook for users with accessibility issues.
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

649 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