Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / June 2005

Tip: Looking for answers? Try searching our database.

find automatic numbering macro

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Kurtis - 29 Jun 2005 01:11 GMT
I created a macro that finds various manual numbering in the document,
deletes it, and depending on the location of the number from the margin,
applies a heading 1-5 style.

The problem I'm having is finding current automatic numbering in the
document, so I can replace it with it a Heading style.  On occasion, a user
may start to apply auto numbering and give up.  I know there isn't a way to
do a find and replace but I'm wondering if anyone knows of a macro that can
find automatic numbering.  Any help would be greatly appreciated.
Jezebel - 29 Jun 2005 01:55 GMT
Iterate the paragraphs, examining the properties of the ListFormat object in
each case. Eg, the ListString property, which shows whatever is actually
displayed as the automatic number (nothing if not numbered).

>I created a macro that finds various manual numbering in the document,
> deletes it, and depending on the location of the number from the margin,
[quoted text clipped - 8 lines]
> can
> find automatic numbering.  Any help would be greatly appreciated.
Klaus Linke - 29 Jun 2005 02:14 GMT
Hi Kurtis,

This should do for a start:

? myParagraphRange.ListFormat.ListType

It'll return
1 (wdListListNumOnly) for ListNum fields,
2 (wdListBullet) for bullets,
3 (wdListSimpleNumbering) for simple numbering,
4 (wdListOutlineNumbering) for outline numbering and (the new) list styles,
5 (wdListMixedNumbering) for some mixture of the above.

Don't know what wdListMixedNumbering means, exactly. The only case I could
imagine (ListNum field plus some other auto-numbering) always gives me 1
(wdListNumOnly), which seems wrong.

For the actual text ("1.1." ...) that appears, you can use

? myParagraphRange.ListFormat.ListString

The VBA help should answer most of your questions, also, the
www.word.mvps.org FAQs have an article on ListString.

Regards,
Klaus

>I created a macro that finds various manual numbering in the document,
> deletes it, and depending on the location of the number from the margin,
[quoted text clipped - 8 lines]
> can
> find automatic numbering.  Any help would be greatly appreciated.
Kurtis - 29 Jun 2005 17:47 GMT
That was what I was missing.  After going through the Listformat commands I
found the following, which does exactly what I need it to.  Thank you very
much:

Selection.Range.ListFormat.ConvertNumbersToText

> Hi Kurtis,
>
[quoted text clipped - 35 lines]
> > can
> > find automatic numbering.  Any help would be greatly appreciated.

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.