Any way to limit ConvertNumbersToText

A

Ari Bendicoff

I have a document with lots of different instances of auto-numbering.
I want to hardcode only the auto numbering that is contained in
tables. Is there any way to constrain the ConvertNumbersToText
command to only include or exclude certain items? For instance I know
that the command ActiveDocument.Tables.ConvertNumbersToText is
invalid, but is there any way to make that idea work?
 
K

Klaus Linke

Ari Bendicoff said:
I have a document with lots of different instances of auto-numbering.
I want to hardcode only the auto numbering that is contained in
tables. Is there any way to constrain the ConvertNumbersToText
command to only include or exclude certain items? For instance I know
that the command ActiveDocument.Tables.ConvertNumbersToText is
invalid, but is there any way to make that idea work?


Hi Ari,

There are two "built-in" ways to restrict the numbers that get converted.

..ConvertNumbersToText can take an argument,
..ConvertNumbersToText(NumberType)
which allows you to specify whether paragraph auto-numbering or LISTNUM
fields or both are converted.

That's not terribly helpful though, since most times you have only one of
the two anyway.

Then you can only convert one specific list...
Say to convert only the list that the cursor is in:
Selection.Range.ListFormat.ConvertNumbersToText

A list in Word covers the whole document, though, and some of it may be
inside a table and other list items may not.

The only safe way to do what you want to do would be to write your own macro
that loops through all auto-numbered paragraphs, and replaces the list
string with hard text, if the paragraph is in a table.
That's a hard job though, if you have to make sure that this doesn't mess up
the numbers (possibly outside a table) that belong to the same list, further
down.

Regards,
Klaus
 
A

Ari Bendicoff

Klaus,

Thanks so much for your help, sadly my document has all the worst case
scenarios you described. 1) All the lists are of the same number
type. 2) The table and non-tables numbers are interspersed so no
range selector. 3) I tried a macro and yes, since the numbering in
the tables is continuous, as soon as it changed one paragraph, all the
numbering was thrown off.

Thanks again for your help!
 
K

Klaus Linke

If it's not essential, I would probably give up on the idea, myself.
If you want to get the macro working, you might start a thread in one of the
Word VBA groups.

Regards,
Klaus
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top