Discussion:
Converting auto numbers to fixed numbers
(too old to reply)
Jezebel
2004-09-07 22:00:50 UTC
Permalink
There's no automatic way. It could be done with VBA, but even then, not
easy.
Hi,
I have been using the style "Heading 4" with autonumbering (e.g. 5.3.2.1)
to
number rows in tables. Now the document is finalized and i need to convert
the auto numbers into fixed/static numbers so that the numbering wont
change
when inserting new rows in the tables.
Does anybody know if this can be done?
Best regards, Bertrand
Suzanne S. Barnhill
2004-09-08 00:07:43 UTC
Permalink
From time to time someone posts a macro to convert numbers to text. It's a
single VBA command.
--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
Word MVP FAQ site: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
Post by Jezebel
There's no automatic way. It could be done with VBA, but even then, not
easy.
Hi,
I have been using the style "Heading 4" with autonumbering (e.g. 5.3.2.1)
to
number rows in tables. Now the document is finalized and i need to convert
the auto numbers into fixed/static numbers so that the numbering wont
change
when inserting new rows in the tables.
Does anybody know if this can be done?
Best regards, Bertrand
Jezebel
2004-09-08 02:10:56 UTC
Permalink
There's a field switch somewhere that does it too, although I can never find
the help topic when I need it. But I don't think that's what the OP is
asking. Unless I've misunderstood, the aim is to convert the number of an
auto-numbered paragraph to literal text (not words for text, but digits as
such) so that adding more items to the list won't cause existing paragraphs
to be renumbered.
Post by Suzanne S. Barnhill
From time to time someone posts a macro to convert numbers to text. It's a
single VBA command.
--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
Word MVP FAQ site: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
Post by Jezebel
There's no automatic way. It could be done with VBA, but even then, not
easy.
Hi,
I have been using the style "Heading 4" with autonumbering (e.g.
5.3.2.1)
Post by Jezebel
to
number rows in tables. Now the document is finalized and i need to
convert
Post by Jezebel
the auto numbers into fixed/static numbers so that the numbering wont
change
when inserting new rows in the tables.
Does anybody know if this can be done?
Best regards, Bertrand
Suzanne S. Barnhill
2004-09-08 02:33:12 UTC
Permalink
Converting autonumbers to literal text is what I'm talking about. There's a
ConvertNumbersToText command or the like in VBA that does this. Surely
someone will be along with it shortly. Ah, wait...thank you, Google: first
hit is a post from Dave Rado three years ago:

Create a macro containing one line:

ActiveDocument.ConvertNumbersToText

and run it

Another post
(http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&safe=off&selm=850201c205
08%24d9ee1010%243bef2ecf%40TKMSFTNGXA10) has a longer discussion but ends up
with the following:

You can run a line of code:
ActiveDocument.ConvertNumbersToText(wdNumberAllNumbers)

You would do this by first going Tools / Macro / Visual
Basic Editor
then typing the phrase in the Immediate window, hitting
Enter, then going File / Close ...

With toolbar numbers, this actually gives a pretty good
result. (You'll eventually want to Close the document
without Saving.)

However, with style-based numbers, it's a messy
situation. The paragraphs still retain the old style
names, even though the numbers are manual. (You can tell
they're manual because your cursor can reach them.)

To be really thorough, you should apply different styles
to those paragraphs.

I found that with VBA, it was helpful to use an
unimportant practice document first.

A post in another, similar thread says:

There's a VBA method that does exactly that called "ConvertNumbersToText".
The method is available from the document object,
so you can convert all the autonumbering in your document to text with just
the command:
"ActiveDocument.ConvertNumbersToText"

The method is also available from the List object, if you only want to apply
it to certain subsets of autonumbers in your doc. (like all the all outline
numbered paragaphs but not bulleted paragraphs), and it's available from the
Range.ListFormat object, if you only want to apply it to a certain range in
your document.

See more info in online help under "ConvertNumbersToText."

Other answers turned up by Google suggest copying and pasting as "Plain
Text."
--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
Word MVP FAQ site: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
Post by Jezebel
There's a field switch somewhere that does it too, although I can never find
the help topic when I need it. But I don't think that's what the OP is
asking. Unless I've misunderstood, the aim is to convert the number of an
auto-numbered paragraph to literal text (not words for text, but digits as
such) so that adding more items to the list won't cause existing paragraphs
to be renumbered.
Post by Suzanne S. Barnhill
From time to time someone posts a macro to convert numbers to text. It's a
single VBA command.
--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
Word MVP FAQ site: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the
newsgroup
Post by Jezebel
so
Post by Suzanne S. Barnhill
all may benefit.
Post by Jezebel
There's no automatic way. It could be done with VBA, but even then, not
easy.
Hi,
I have been using the style "Heading 4" with autonumbering (e.g.
5.3.2.1)
Post by Jezebel
to
number rows in tables. Now the document is finalized and i need to
convert
Post by Jezebel
the auto numbers into fixed/static numbers so that the numbering wont
change
when inserting new rows in the tables.
Does anybody know if this can be done?
Best regards, Bertrand
Bertrand
2004-09-09 09:13:03 UTC
Permalink
Thank you for setting me on the right track! I made this macro on your
recommandations:

Sub ConvertAutoNumberToText()
Dim lst As List
Dim par As Paragraph
Dim str As String
Dim i As Integer

str = InputBox("Enter the name (case sensitive) of the style " & _
"which autonumbers should be converted to text: ", "Convert
autonumber to text")

If str <> "" Then
i = 0
For Each lst In ActiveDocument.Lists
For Each par In lst.ListParagraphs
If par.Style = str Then
i = i + 1
par.Range.ListFormat.ConvertNumbersToText
wdNumberParagraph
End If
Next
Next
MsgBox "Conversion of style '" & str & "' done!" & vbLf & i & "
instances of the style were found."
End If
End Sub
Post by Suzanne S. Barnhill
Converting autonumbers to literal text is what I'm talking about. There's a
ConvertNumbersToText command or the like in VBA that does this. Surely
someone will be along with it shortly. Ah, wait...thank you, Google: first
ActiveDocument.ConvertNumbersToText
and run it
Another post
(http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&safe=off&selm=850201c205
08%24d9ee1010%243bef2ecf%40TKMSFTNGXA10) has a longer discussion but ends up
ActiveDocument.ConvertNumbersToText(wdNumberAllNumbers)
You would do this by first going Tools / Macro / Visual
Basic Editor
then typing the phrase in the Immediate window, hitting
Enter, then going File / Close ...
With toolbar numbers, this actually gives a pretty good
result. (You'll eventually want to Close the document
without Saving.)
However, with style-based numbers, it's a messy
situation. The paragraphs still retain the old style
names, even though the numbers are manual. (You can tell
they're manual because your cursor can reach them.)
To be really thorough, you should apply different styles
to those paragraphs.
I found that with VBA, it was helpful to use an
unimportant practice document first.
There's a VBA method that does exactly that called "ConvertNumbersToText".
The method is available from the document object,
so you can convert all the autonumbering in your document to text with just
"ActiveDocument.ConvertNumbersToText"
The method is also available from the List object, if you only want to apply
it to certain subsets of autonumbers in your doc. (like all the all outline
numbered paragaphs but not bulleted paragraphs), and it's available from the
Range.ListFormat object, if you only want to apply it to a certain range in
your document.
See more info in online help under "ConvertNumbersToText."
Other answers turned up by Google suggest copying and pasting as "Plain
Text."
--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
Word MVP FAQ site: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
Post by Jezebel
There's a field switch somewhere that does it too, although I can never
find
Post by Jezebel
the help topic when I need it. But I don't think that's what the OP is
asking. Unless I've misunderstood, the aim is to convert the number of an
auto-numbered paragraph to literal text (not words for text, but digits as
such) so that adding more items to the list won't cause existing
paragraphs
Post by Jezebel
to be renumbered.
Post by Suzanne S. Barnhill
From time to time someone posts a macro to convert numbers to text. It's
a
Post by Jezebel
Post by Suzanne S. Barnhill
single VBA command.
--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
Word MVP FAQ site: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the
newsgroup
Post by Jezebel
so
Post by Suzanne S. Barnhill
all may benefit.
Post by Jezebel
There's no automatic way. It could be done with VBA, but even then,
not
Post by Jezebel
Post by Suzanne S. Barnhill
Post by Jezebel
easy.
Hi,
I have been using the style "Heading 4" with autonumbering (e.g.
5.3.2.1)
Post by Jezebel
to
number rows in tables. Now the document is finalized and i need to
convert
Post by Jezebel
the auto numbers into fixed/static numbers so that the numbering
wont
Post by Jezebel
Post by Suzanne S. Barnhill
Post by Jezebel
change
when inserting new rows in the tables.
Does anybody know if this can be done?
Best regards, Bertrand
Continue reading on narkive:
Loading...