Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.docmanagement
Monte Beery Monte Beery is offline
external usenet poster
 
Posts: 1
Default Retain numbering when extracted from list

I often need to extract a few entries from a page of numbered paragraphs, but
want to retain the original numbering for reference to the original document.

1. first paragraph
2. second paragraph
2.1 clause in second paragraph
3 third paragraph

Extract the second paragraph and its clause, but retain the numbering thus...

2 second paragraph
2.1 clause in second paragraph

Word will routinely renumber the lines...

1 second paragraph
1.1 clause in second paragraph

How do I achieve my goal of retaining the numbering when I extract a part of
a numbered list?

Thanks for your assistance,
Monte
  #2   Report Post  
Posted to microsoft.public.word.docmanagement
Suzanne S. Barnhill Suzanne S. Barnhill is offline
external usenet poster
 
Posts: 33,624
Default Retain numbering when extracted from list

You can convert the numbers to text using these instructions provided by
Stefan Blom:

To convert autonumbering (paragraph/outline numbering and LISTNUM
fields) to plain text, do the following: Make sure the active
document is the one you want to convert. Then press ALT+F11 to
display the Visual Basic Editor. On the View menu, click
Immediate Window. In the Immediate Window, type

ActiveDocument.ConvertNumbersToText

and press ENTER.

Note that if paragraph/outline numbering was applied with styles,
it isn't completely gone (CTRL+Q will bring it back!) unless you
also clear it from the style definitions.

Note that Stefan's instructions are for the entire document. I can't tell
you the appropriate macro for a selection (perhaps
Selection.ConvertNumbersToText), but perhaps someone else will chime in with
that. Alternatively, you could make a copy of the document, run the macro,
and then copy/paste the relevant bit into your good doc.

--
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.

"Monte Beery" Monte wrote in message
...
I often need to extract a few entries from a page of numbered paragraphs,

but
want to retain the original numbering for reference to the original

document.

1. first paragraph
2. second paragraph
2.1 clause in second paragraph
3 third paragraph

Extract the second paragraph and its clause, but retain the numbering

thus...

2 second paragraph
2.1 clause in second paragraph

Word will routinely renumber the lines...

1 second paragraph
1.1 clause in second paragraph

How do I achieve my goal of retaining the numbering when I extract a part

of
a numbered list?

Thanks for your assistance,
Monte


  #3   Report Post  
Posted to microsoft.public.word.docmanagement
Lene Fredborg Lene Fredborg is offline
external usenet poster
 
Posts: 1,291
Default Retain numbering when extracted from list

ConvertNumbersToText cannot be used with the Selection object so
Selection.ConvertNumbersToText will not work.

A macro like the one below could be used to change the numbers in the
selection only. However, it may be safer to do as Suzanne suggested, i.e.
copy the document, change all numbers to text using
ActiveDocument.ConvertNumbersToText and then just use whatever you need from
the document.

The problem with changing only part of the numbers to text is that this will
make all subsequent numbers that belong to the same list(s) wrong - the
subsequent numbers will act as if you have deleted the numbers that you
converted to text. The result could be rather confusing even if you could
undo the change at once after you copied the relevant text. Anyway, here is
the macro:

Sub ConvertNumbersInSelectionToText()

Dim oDoc As Document
Dim oRange As Range

Set oDoc = ActiveDocument
Set oRange = _
oDoc.Range(Start:=Selection.Range.Start, _
End:=Selection.Range.End)
oRange.ListFormat.ConvertNumbersToText wdNumberParagraph

Set oDoc = Nothing
Set oRange = Nothing

End Sub

--
Regards
Lene Fredborg
DocTools - Denmark
www.thedoctools.com
Document automation - add-ins, macros and templates for Microsoft Word


"Suzanne S. Barnhill" wrote:

You can convert the numbers to text using these instructions provided by
Stefan Blom:

To convert autonumbering (paragraph/outline numbering and LISTNUM
fields) to plain text, do the following: Make sure the active
document is the one you want to convert. Then press ALT+F11 to
display the Visual Basic Editor. On the View menu, click
Immediate Window. In the Immediate Window, type

ActiveDocument.ConvertNumbersToText

and press ENTER.

Note that if paragraph/outline numbering was applied with styles,
it isn't completely gone (CTRL+Q will bring it back!) unless you
also clear it from the style definitions.

Note that Stefan's instructions are for the entire document. I can't tell
you the appropriate macro for a selection (perhaps
Selection.ConvertNumbersToText), but perhaps someone else will chime in with
that. Alternatively, you could make a copy of the document, run the macro,
and then copy/paste the relevant bit into your good doc.

--
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.

"Monte Beery" Monte wrote in message
...
I often need to extract a few entries from a page of numbered paragraphs,

but
want to retain the original numbering for reference to the original

document.

1. first paragraph
2. second paragraph
2.1 clause in second paragraph
3 third paragraph

Extract the second paragraph and its clause, but retain the numbering

thus...

2 second paragraph
2.1 clause in second paragraph

Word will routinely renumber the lines...

1 second paragraph
1.1 clause in second paragraph

How do I achieve my goal of retaining the numbering when I extract a part

of
a numbered list?

Thanks for your assistance,
Monte



  #4   Report Post  
Posted to microsoft.public.word.docmanagement
Suzanne S. Barnhill Suzanne S. Barnhill is offline
external usenet poster
 
Posts: 33,624
Default Retain numbering when extracted from list

I don't *think* the OP wants to freeze the numbers on part of a list in
place but rather to be able to "quote" these numbered paragraphs elsewhere,
retaining the numbers they have in place.

--
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.

"Lene Fredborg" wrote in message
...
ConvertNumbersToText cannot be used with the Selection object so
Selection.ConvertNumbersToText will not work.

A macro like the one below could be used to change the numbers in the
selection only. However, it may be safer to do as Suzanne suggested, i.e.
copy the document, change all numbers to text using
ActiveDocument.ConvertNumbersToText and then just use whatever you need

from
the document.

The problem with changing only part of the numbers to text is that this

will
make all subsequent numbers that belong to the same list(s) wrong - the
subsequent numbers will act as if you have deleted the numbers that you
converted to text. The result could be rather confusing even if you could
undo the change at once after you copied the relevant text. Anyway, here

is
the macro:

Sub ConvertNumbersInSelectionToText()

Dim oDoc As Document
Dim oRange As Range

Set oDoc = ActiveDocument
Set oRange = _
oDoc.Range(Start:=Selection.Range.Start, _
End:=Selection.Range.End)
oRange.ListFormat.ConvertNumbersToText wdNumberParagraph

Set oDoc = Nothing
Set oRange = Nothing

End Sub

--
Regards
Lene Fredborg
DocTools - Denmark
www.thedoctools.com
Document automation - add-ins, macros and templates for Microsoft Word


"Suzanne S. Barnhill" wrote:

You can convert the numbers to text using these instructions provided by
Stefan Blom:

To convert autonumbering (paragraph/outline numbering and LISTNUM
fields) to plain text, do the following: Make sure the active
document is the one you want to convert. Then press ALT+F11 to
display the Visual Basic Editor. On the View menu, click
Immediate Window. In the Immediate Window, type

ActiveDocument.ConvertNumbersToText

and press ENTER.

Note that if paragraph/outline numbering was applied with styles,
it isn't completely gone (CTRL+Q will bring it back!) unless you
also clear it from the style definitions.

Note that Stefan's instructions are for the entire document. I can't

tell
you the appropriate macro for a selection (perhaps
Selection.ConvertNumbersToText), but perhaps someone else will chime in

with
that. Alternatively, you could make a copy of the document, run the

macro,
and then copy/paste the relevant bit into your good doc.

--
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.

"Monte Beery" Monte wrote in message
...
I often need to extract a few entries from a page of numbered

paragraphs,
but
want to retain the original numbering for reference to the original

document.

1. first paragraph
2. second paragraph
2.1 clause in second paragraph
3 third paragraph

Extract the second paragraph and its clause, but retain the numbering

thus...

2 second paragraph
2.1 clause in second paragraph

Word will routinely renumber the lines...

1 second paragraph
1.1 clause in second paragraph

How do I achieve my goal of retaining the numbering when I extract a

part
of
a numbered list?

Thanks for your assistance,
Monte




  #5   Report Post  
Posted to microsoft.public.word.docmanagement
Lene Fredborg Lene Fredborg is offline
external usenet poster
 
Posts: 1,291
Default Retain numbering when extracted from list

Suzanne, that is also how I understood the OP so I may have expressed myself
unclear. What I meant was: you can change the numbers in the selection using
the macro, copy the text (that is still selected), then undo to bring the
numbers back. However, I just imagined that one could be confused by the mix
of numbers in the meantime and then by mistake do something wrong.

But there may be an easy and, hopefully, safe way: below is the macro in an
extended version. The macro changes the numbers in the selection to normal
text, copies the selection and undoes the change (i.e. reverts the numbers
back). The user then only needs to 1) select the desired text, 2) run the
macro and 3) paste the already copied text (with the fixed numbers) into the
relevant place.

Sub ConvertNumbersInSelectionToText_CopyText()

Dim oDoc As Document
Dim oRange As Range

Set oDoc = ActiveDocument
Set oRange = _
oDoc.Range(Start:=Selection.Range.Start, _
End:=Selection.Range.End)
oRange.ListFormat.ConvertNumbersToText wdNumberParagraph
'Copy the selection while numbers are converted
Selection.Copy
'Then undo so that numbers revert to the original
oDoc.Undo

Set oDoc = Nothing
Set oRange = Nothing
End Sub

--
Regards
Lene Fredborg
DocTools - Denmark
www.thedoctools.com
Document automation - add-ins, macros and templates for Microsoft Word


"Suzanne S. Barnhill" wrote:

I don't *think* the OP wants to freeze the numbers on part of a list in
place but rather to be able to "quote" these numbered paragraphs elsewhere,
retaining the numbers they have in place.

--
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.

"Lene Fredborg" wrote in message
...
ConvertNumbersToText cannot be used with the Selection object so
Selection.ConvertNumbersToText will not work.

A macro like the one below could be used to change the numbers in the
selection only. However, it may be safer to do as Suzanne suggested, i.e.
copy the document, change all numbers to text using
ActiveDocument.ConvertNumbersToText and then just use whatever you need

from
the document.

The problem with changing only part of the numbers to text is that this

will
make all subsequent numbers that belong to the same list(s) wrong - the
subsequent numbers will act as if you have deleted the numbers that you
converted to text. The result could be rather confusing even if you could
undo the change at once after you copied the relevant text. Anyway, here

is
the macro:

Sub ConvertNumbersInSelectionToText()

Dim oDoc As Document
Dim oRange As Range

Set oDoc = ActiveDocument
Set oRange = _
oDoc.Range(Start:=Selection.Range.Start, _
End:=Selection.Range.End)
oRange.ListFormat.ConvertNumbersToText wdNumberParagraph

Set oDoc = Nothing
Set oRange = Nothing

End Sub

--
Regards
Lene Fredborg
DocTools - Denmark
www.thedoctools.com
Document automation - add-ins, macros and templates for Microsoft Word


"Suzanne S. Barnhill" wrote:

You can convert the numbers to text using these instructions provided by
Stefan Blom:

To convert autonumbering (paragraph/outline numbering and LISTNUM
fields) to plain text, do the following: Make sure the active
document is the one you want to convert. Then press ALT+F11 to
display the Visual Basic Editor. On the View menu, click
Immediate Window. In the Immediate Window, type

ActiveDocument.ConvertNumbersToText

and press ENTER.

Note that if paragraph/outline numbering was applied with styles,
it isn't completely gone (CTRL+Q will bring it back!) unless you
also clear it from the style definitions.

Note that Stefan's instructions are for the entire document. I can't

tell
you the appropriate macro for a selection (perhaps
Selection.ConvertNumbersToText), but perhaps someone else will chime in

with
that. Alternatively, you could make a copy of the document, run the

macro,
and then copy/paste the relevant bit into your good doc.

--
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.

"Monte Beery" Monte wrote in message
...
I often need to extract a few entries from a page of numbered

paragraphs,
but
want to retain the original numbering for reference to the original
document.

1. first paragraph
2. second paragraph
2.1 clause in second paragraph
3 third paragraph

Extract the second paragraph and its clause, but retain the numbering
thus...

2 second paragraph
2.1 clause in second paragraph

Word will routinely renumber the lines...

1 second paragraph
1.1 clause in second paragraph

How do I achieve my goal of retaining the numbering when I extract a

part
of
a numbered list?

Thanks for your assistance,
Monte






  #6   Report Post  
Posted to microsoft.public.word.docmanagement
Suzanne S. Barnhill Suzanne S. Barnhill is offline
external usenet poster
 
Posts: 33,624
Default Retain numbering when extracted from list

Ah, I see. Well, I have no VBA expertise, so I didn't read your macro to see
what it was doing. Sorry.

--
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.

"Lene Fredborg" wrote in message
...
Suzanne, that is also how I understood the OP so I may have expressed

myself
unclear. What I meant was: you can change the numbers in the selection

using
the macro, copy the text (that is still selected), then undo to bring the
numbers back. However, I just imagined that one could be confused by the

mix
of numbers in the meantime and then by mistake do something wrong.

But there may be an easy and, hopefully, safe way: below is the macro in

an
extended version. The macro changes the numbers in the selection to normal
text, copies the selection and undoes the change (i.e. reverts the numbers
back). The user then only needs to 1) select the desired text, 2) run the
macro and 3) paste the already copied text (with the fixed numbers) into

the
relevant place.

Sub ConvertNumbersInSelectionToText_CopyText()

Dim oDoc As Document
Dim oRange As Range

Set oDoc = ActiveDocument
Set oRange = _
oDoc.Range(Start:=Selection.Range.Start, _
End:=Selection.Range.End)
oRange.ListFormat.ConvertNumbersToText wdNumberParagraph
'Copy the selection while numbers are converted
Selection.Copy
'Then undo so that numbers revert to the original
oDoc.Undo

Set oDoc = Nothing
Set oRange = Nothing
End Sub

--
Regards
Lene Fredborg
DocTools - Denmark
www.thedoctools.com
Document automation - add-ins, macros and templates for Microsoft Word


"Suzanne S. Barnhill" wrote:

I don't *think* the OP wants to freeze the numbers on part of a list in
place but rather to be able to "quote" these numbered paragraphs

elsewhere,
retaining the numbers they have in place.

--
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.

"Lene Fredborg" wrote in message
...
ConvertNumbersToText cannot be used with the Selection object so
Selection.ConvertNumbersToText will not work.

A macro like the one below could be used to change the numbers in the
selection only. However, it may be safer to do as Suzanne suggested,

i.e.
copy the document, change all numbers to text using
ActiveDocument.ConvertNumbersToText and then just use whatever you

need
from
the document.

The problem with changing only part of the numbers to text is that

this
will
make all subsequent numbers that belong to the same list(s) wrong -

the
subsequent numbers will act as if you have deleted the numbers that

you
converted to text. The result could be rather confusing even if you

could
undo the change at once after you copied the relevant text. Anyway,

here
is
the macro:

Sub ConvertNumbersInSelectionToText()

Dim oDoc As Document
Dim oRange As Range

Set oDoc = ActiveDocument
Set oRange = _
oDoc.Range(Start:=Selection.Range.Start, _
End:=Selection.Range.End)
oRange.ListFormat.ConvertNumbersToText wdNumberParagraph

Set oDoc = Nothing
Set oRange = Nothing

End Sub

--
Regards
Lene Fredborg
DocTools - Denmark
www.thedoctools.com
Document automation - add-ins, macros and templates for Microsoft Word


"Suzanne S. Barnhill" wrote:

You can convert the numbers to text using these instructions

provided by
Stefan Blom:

To convert autonumbering (paragraph/outline numbering and LISTNUM
fields) to plain text, do the following: Make sure the active
document is the one you want to convert. Then press ALT+F11 to
display the Visual Basic Editor. On the View menu, click
Immediate Window. In the Immediate Window, type

ActiveDocument.ConvertNumbersToText

and press ENTER.

Note that if paragraph/outline numbering was applied with styles,
it isn't completely gone (CTRL+Q will bring it back!) unless you
also clear it from the style definitions.

Note that Stefan's instructions are for the entire document. I can't

tell
you the appropriate macro for a selection (perhaps
Selection.ConvertNumbersToText), but perhaps someone else will chime

in
with
that. Alternatively, you could make a copy of the document, run the

macro,
and then copy/paste the relevant bit into your good doc.

--
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.

"Monte Beery" Monte wrote in

message
...
I often need to extract a few entries from a page of numbered

paragraphs,
but
want to retain the original numbering for reference to the

original
document.

1. first paragraph
2. second paragraph
2.1 clause in second paragraph
3 third paragraph

Extract the second paragraph and its clause, but retain the

numbering
thus...

2 second paragraph
2.1 clause in second paragraph

Word will routinely renumber the lines...

1 second paragraph
1.1 clause in second paragraph

How do I achieve my goal of retaining the numbering when I extract

a
part
of
a numbered list?

Thanks for your assistance,
Monte





  #7   Report Post  
Posted to microsoft.public.word.docmanagement
Monte Beery[_2_] Monte Beery[_2_] is offline
external usenet poster
 
Posts: 1
Default Retain numbering when extracted from list

My thanks to both Lene and Suzanne! Both responses were on point. I will
add Lene's macro to my collection and share with others. I continue to be
amazed at the expertise and generosity of the user community!

"Lene Fredborg" wrote:

Suzanne, that is also how I understood the OP so I may have expressed myself
unclear. What I meant was: you can change the numbers in the selection using
the macro, copy the text (that is still selected), then undo to bring the
numbers back. However, I just imagined that one could be confused by the mix
of numbers in the meantime and then by mistake do something wrong.

But there may be an easy and, hopefully, safe way: below is the macro in an
extended version. The macro changes the numbers in the selection to normal
text, copies the selection and undoes the change (i.e. reverts the numbers
back). The user then only needs to 1) select the desired text, 2) run the
macro and 3) paste the already copied text (with the fixed numbers) into the
relevant place.

Sub ConvertNumbersInSelectionToText_CopyText()

Dim oDoc As Document
Dim oRange As Range

Set oDoc = ActiveDocument
Set oRange = _
oDoc.Range(Start:=Selection.Range.Start, _
End:=Selection.Range.End)
oRange.ListFormat.ConvertNumbersToText wdNumberParagraph
'Copy the selection while numbers are converted
Selection.Copy
'Then undo so that numbers revert to the original
oDoc.Undo

Set oDoc = Nothing
Set oRange = Nothing
End Sub

--
Regards
Lene Fredborg
DocTools - Denmark
www.thedoctools.com
Document automation - add-ins, macros and templates for Microsoft Word


"Suzanne S. Barnhill" wrote:

I don't *think* the OP wants to freeze the numbers on part of a list in
place but rather to be able to "quote" these numbered paragraphs elsewhere,
retaining the numbers they have in place.

--
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.

"Lene Fredborg" wrote in message
...
ConvertNumbersToText cannot be used with the Selection object so
Selection.ConvertNumbersToText will not work.

A macro like the one below could be used to change the numbers in the
selection only. However, it may be safer to do as Suzanne suggested, i.e.
copy the document, change all numbers to text using
ActiveDocument.ConvertNumbersToText and then just use whatever you need

from
the document.

The problem with changing only part of the numbers to text is that this

will
make all subsequent numbers that belong to the same list(s) wrong - the
subsequent numbers will act as if you have deleted the numbers that you
converted to text. The result could be rather confusing even if you could
undo the change at once after you copied the relevant text. Anyway, here

is
the macro:

Sub ConvertNumbersInSelectionToText()

Dim oDoc As Document
Dim oRange As Range

Set oDoc = ActiveDocument
Set oRange = _
oDoc.Range(Start:=Selection.Range.Start, _
End:=Selection.Range.End)
oRange.ListFormat.ConvertNumbersToText wdNumberParagraph

Set oDoc = Nothing
Set oRange = Nothing

End Sub

--
Regards
Lene Fredborg
DocTools - Denmark
www.thedoctools.com
Document automation - add-ins, macros and templates for Microsoft Word


"Suzanne S. Barnhill" wrote:

You can convert the numbers to text using these instructions provided by
Stefan Blom:

To convert autonumbering (paragraph/outline numbering and LISTNUM
fields) to plain text, do the following: Make sure the active
document is the one you want to convert. Then press ALT+F11 to
display the Visual Basic Editor. On the View menu, click
Immediate Window. In the Immediate Window, type

ActiveDocument.ConvertNumbersToText

and press ENTER.

Note that if paragraph/outline numbering was applied with styles,
it isn't completely gone (CTRL+Q will bring it back!) unless you
also clear it from the style definitions.

Note that Stefan's instructions are for the entire document. I can't

tell
you the appropriate macro for a selection (perhaps
Selection.ConvertNumbersToText), but perhaps someone else will chime in

with
that. Alternatively, you could make a copy of the document, run the

macro,
and then copy/paste the relevant bit into your good doc.

--
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.

"Monte Beery" Monte wrote in message
...
I often need to extract a few entries from a page of numbered

paragraphs,
but
want to retain the original numbering for reference to the original
document.

1. first paragraph
2. second paragraph
2.1 clause in second paragraph
3 third paragraph

Extract the second paragraph and its clause, but retain the numbering
thus...

2 second paragraph
2.1 clause in second paragraph

Word will routinely renumber the lines...

1 second paragraph
1.1 clause in second paragraph

How do I achieve my goal of retaining the numbering when I extract a

part
of
a numbered list?

Thanks for your assistance,
Monte




  #8   Report Post  
Posted to microsoft.public.word.docmanagement
Henk57[_43_] Henk57[_43_] is offline
external usenet poster
 
Posts: 1
Default Retain numbering when extracted from list


FWIW, when I select an item from a numbered list (Word 2003), and
copy/paste it as unformatted text (via Paste Special) in the body text,
the text pasted includes the original number, but of course formatted as
text, not as numbered list anymore. Isn't that what Monte needs, or do
I misunderstand the question? Or do I have an obscure setting that
brings this about?

'Monte Beery[_2_ Wrote:
;2228143']My thanks to both Lene and Suzanne! Both responses were on
point. I will
add Lene's macro to my collection and share with others. I continue to
be
amazed at the expertise and generosity of the user community!

"Lene Fredborg" wrote:
-
Suzanne, that is also how I understood the OP so I may have expressed
myself
unclear. What I meant was: you can change the numbers in the selection
using
the macro, copy the text (that is still selected), then undo to bring
the
numbers back. However, I just imagined that one could be confused by
the mix
of numbers in the meantime and then by mistake do something wrong.

But there may be an easy and, hopefully, safe way: below is the macro
in an
extended version. The macro changes the numbers in the selection to
normal
text, copies the selection and undoes the change (i.e. reverts the
numbers
back). The user then only needs to 1) select the desired text, 2) run
the
macro and 3) paste the already copied text (with the fixed numbers)
into the
relevant place.

Sub ConvertNumbersInSelectionToText_CopyText()

Dim oDoc As Document
Dim oRange As Range

Set oDoc = ActiveDocument
Set oRange = _
oDoc.Range(Start:=Selection.Range.Start, _
End:=Selection.Range.End)
oRange.ListFormat.ConvertNumbersToText wdNumberParagraph
'Copy the selection while numbers are converted
Selection.Copy
'Then undo so that numbers revert to the original
oDoc.Undo

Set oDoc = Nothing
Set oRange = Nothing
End Sub

--
Regards
Lene Fredborg
DocTools - Denmark
www.thedoctools.com
Document automation - add-ins, macros and templates for Microsoft
Word


"Suzanne S. Barnhill" wrote:
-
I don't *think* the OP wants to freeze the numbers on part of a list
in
place but rather to be able to "quote" these numbered paragraphs
elsewhere,
retaining the numbers they have in place.

--
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.

"Lene Fredborg" wrote in message
...-
ConvertNumbersToText cannot be used with the Selection object so
Selection.ConvertNumbersToText will not work.

A macro like the one below could be used to change the numbers in
the
selection only. However, it may be safer to do as Suzanne suggested,
i.e.
copy the document, change all numbers to text using
ActiveDocument.ConvertNumbersToText and then just use whatever you
need-
from-
the document.

The problem with changing only part of the numbers to text is that
this-
will-
make all subsequent numbers that belong to the same list(s) wrong -
the
subsequent numbers will act as if you have deleted the numbers that
you
converted to text. The result could be rather confusing even if you
could
undo the change at once after you copied the relevant text. Anyway,
here-
is-
the macro:

Sub ConvertNumbersInSelectionToText()

Dim oDoc As Document
Dim oRange As Range

Set oDoc = ActiveDocument
Set oRange = _
oDoc.Range(Start:=Selection.Range.Start, _
End:=Selection.Range.End)
oRange.ListFormat.ConvertNumbersToText wdNumberParagraph

Set oDoc = Nothing
Set oRange = Nothing

End Sub

--
Regards
Lene Fredborg
DocTools - Denmark
www.thedoctools.com
Document automation - add-ins, macros and templates for Microsoft
Word


"Suzanne S. Barnhill" wrote:

You can convert the numbers to text using these instructions
provided by
Stefan Blom:

To convert autonumbering (paragraph/outline numbering and LISTNUM
fields) to plain text, do the following: Make sure the active
document is the one you want to convert. Then press ALT+F11 to
display the Visual Basic Editor. On the View menu, click
Immediate Window. In the Immediate Window, type

ActiveDocument.ConvertNumbersToText

and press ENTER.

Note that if paragraph/outline numbering was applied with styles,
it isn't completely gone (CTRL+Q will bring it back!) unless you
also clear it from the style definitions.

Note that Stefan's instructions are for the entire document. I
can't-
tell-
you the appropriate macro for a selection (perhaps
Selection.ConvertNumbersToText), but perhaps someone else will
chime in-
with-
that. Alternatively, you could make a copy of the document, run
the-
macro,-
and then copy/paste the relevant bit into your good doc.

--
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.

"Monte Beery" Monte wrote in
message
...
I often need to extract a few entries from a page of numbered-
paragraphs,-
but
want to retain the original numbering for reference to the
original
document.

1. first paragraph
2. second paragraph
2.1 clause in second paragraph
3 third paragraph

Extract the second paragraph and its clause, but retain the
numbering
thus...

2 second paragraph
2.1 clause in second paragraph

Word will routinely renumber the lines...

1 second paragraph
1.1 clause in second paragraph

How do I achieve my goal of retaining the numbering when I extract
a-
part-
of
a numbered list?

Thanks for your assistance,
Monte

-

--





--
Henk57
  #9   Report Post  
Posted to microsoft.public.word.docmanagement
Suzanne S. Barnhill Suzanne S. Barnhill is offline
external usenet poster
 
Posts: 33,624
Default Retain numbering when extracted from list

Of course. This would be the simplest solution of all. Sometimes we don't
see the forest for the trees.

--
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.

"Henk57" wrote in message
...

FWIW, when I select an item from a numbered list (Word 2003), and
copy/paste it as unformatted text (via Paste Special) in the body text,
the text pasted includes the original number, but of course formatted as
text, not as numbered list anymore. Isn't that what Monte needs, or do
I misunderstand the question? Or do I have an obscure setting that
brings this about?

'Monte Beery[_2_ Wrote:
;2228143']My thanks to both Lene and Suzanne! Both responses were on
point. I will
add Lene's macro to my collection and share with others. I continue to
be
amazed at the expertise and generosity of the user community!

"Lene Fredborg" wrote:
-
Suzanne, that is also how I understood the OP so I may have expressed
myself
unclear. What I meant was: you can change the numbers in the selection
using
the macro, copy the text (that is still selected), then undo to bring
the
numbers back. However, I just imagined that one could be confused by
the mix
of numbers in the meantime and then by mistake do something wrong.

But there may be an easy and, hopefully, safe way: below is the macro
in an
extended version. The macro changes the numbers in the selection to
normal
text, copies the selection and undoes the change (i.e. reverts the
numbers
back). The user then only needs to 1) select the desired text, 2) run
the
macro and 3) paste the already copied text (with the fixed numbers)
into the
relevant place.

Sub ConvertNumbersInSelectionToText_CopyText()

Dim oDoc As Document
Dim oRange As Range

Set oDoc = ActiveDocument
Set oRange = _
oDoc.Range(Start:=Selection.Range.Start, _
End:=Selection.Range.End)
oRange.ListFormat.ConvertNumbersToText wdNumberParagraph
'Copy the selection while numbers are converted
Selection.Copy
'Then undo so that numbers revert to the original
oDoc.Undo

Set oDoc = Nothing
Set oRange = Nothing
End Sub

--
Regards
Lene Fredborg
DocTools - Denmark
www.thedoctools.com
Document automation - add-ins, macros and templates for Microsoft
Word


"Suzanne S. Barnhill" wrote:
-
I don't *think* the OP wants to freeze the numbers on part of a list
in
place but rather to be able to "quote" these numbered paragraphs
elsewhere,
retaining the numbers they have in place.

--
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.

"Lene Fredborg" wrote in message
...-
ConvertNumbersToText cannot be used with the Selection object so
Selection.ConvertNumbersToText will not work.

A macro like the one below could be used to change the numbers in
the
selection only. However, it may be safer to do as Suzanne suggested,
i.e.
copy the document, change all numbers to text using
ActiveDocument.ConvertNumbersToText and then just use whatever you
need-
from-
the document.

The problem with changing only part of the numbers to text is that
this-
will-
make all subsequent numbers that belong to the same list(s) wrong -
the
subsequent numbers will act as if you have deleted the numbers that
you
converted to text. The result could be rather confusing even if you
could
undo the change at once after you copied the relevant text. Anyway,
here-
is-
the macro:

Sub ConvertNumbersInSelectionToText()

Dim oDoc As Document
Dim oRange As Range

Set oDoc = ActiveDocument
Set oRange = _
oDoc.Range(Start:=Selection.Range.Start, _
End:=Selection.Range.End)
oRange.ListFormat.ConvertNumbersToText wdNumberParagraph

Set oDoc = Nothing
Set oRange = Nothing

End Sub

--
Regards
Lene Fredborg
DocTools - Denmark
www.thedoctools.com
Document automation - add-ins, macros and templates for Microsoft
Word


"Suzanne S. Barnhill" wrote:

You can convert the numbers to text using these instructions
provided by
Stefan Blom:

To convert autonumbering (paragraph/outline numbering and LISTNUM
fields) to plain text, do the following: Make sure the active
document is the one you want to convert. Then press ALT+F11 to
display the Visual Basic Editor. On the View menu, click
Immediate Window. In the Immediate Window, type

ActiveDocument.ConvertNumbersToText

and press ENTER.

Note that if paragraph/outline numbering was applied with styles,
it isn't completely gone (CTRL+Q will bring it back!) unless you
also clear it from the style definitions.

Note that Stefan's instructions are for the entire document. I
can't-
tell-
you the appropriate macro for a selection (perhaps
Selection.ConvertNumbersToText), but perhaps someone else will
chime in-
with-
that. Alternatively, you could make a copy of the document, run
the-
macro,-
and then copy/paste the relevant bit into your good doc.

--
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.

"Monte Beery" Monte wrote in
message
...
I often need to extract a few entries from a page of numbered-
paragraphs,-
but
want to retain the original numbering for reference to the
original
document.

1. first paragraph
2. second paragraph
2.1 clause in second paragraph
3 third paragraph

Extract the second paragraph and its clause, but retain the
numbering
thus...

2 second paragraph
2.1 clause in second paragraph

Word will routinely renumber the lines...

1 second paragraph
1.1 clause in second paragraph

How do I achieve my goal of retaining the numbering when I extract
a-
part-
of
a numbered list?

Thanks for your assistance,
Monte

-

--





--
Henk57


  #10   Report Post  
Posted to microsoft.public.word.docmanagement
E. Robinson E. Robinson is offline
external usenet poster
 
Posts: 1
Default Retain numbering when extracted from list

This is not exactly true.

If you past as text it looses formatting such as hanging indents. I use
this feature to add comments to reports and need to retain all the
formatting. This is possible using the first method.

"Suzanne S. Barnhill" wrote:

Of course. This would be the simplest solution of all. Sometimes we don't
see the forest for the trees.

--
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.

"Henk57" wrote in message
...

FWIW, when I select an item from a numbered list (Word 2003), and
copy/paste it as unformatted text (via Paste Special) in the body text,
the text pasted includes the original number, but of course formatted as
text, not as numbered list anymore. Isn't that what Monte needs, or do
I misunderstand the question? Or do I have an obscure setting that
brings this about?

'Monte Beery[_2_ Wrote:
;2228143']My thanks to both Lene and Suzanne! Both responses were on
point. I will
add Lene's macro to my collection and share with others. I continue to
be
amazed at the expertise and generosity of the user community!

"Lene Fredborg" wrote:
-
Suzanne, that is also how I understood the OP so I may have expressed
myself
unclear. What I meant was: you can change the numbers in the selection
using
the macro, copy the text (that is still selected), then undo to bring
the
numbers back. However, I just imagined that one could be confused by
the mix
of numbers in the meantime and then by mistake do something wrong.

But there may be an easy and, hopefully, safe way: below is the macro
in an
extended version. The macro changes the numbers in the selection to
normal
text, copies the selection and undoes the change (i.e. reverts the
numbers
back). The user then only needs to 1) select the desired text, 2) run
the
macro and 3) paste the already copied text (with the fixed numbers)
into the
relevant place.

Sub ConvertNumbersInSelectionToText_CopyText()

Dim oDoc As Document
Dim oRange As Range

Set oDoc = ActiveDocument
Set oRange = _
oDoc.Range(Start:=Selection.Range.Start, _
End:=Selection.Range.End)
oRange.ListFormat.ConvertNumbersToText wdNumberParagraph
'Copy the selection while numbers are converted
Selection.Copy
'Then undo so that numbers revert to the original
oDoc.Undo

Set oDoc = Nothing
Set oRange = Nothing
End Sub

--
Regards
Lene Fredborg
DocTools - Denmark
www.thedoctools.com
Document automation - add-ins, macros and templates for Microsoft
Word


"Suzanne S. Barnhill" wrote:
-
I don't *think* the OP wants to freeze the numbers on part of a list
in
place but rather to be able to "quote" these numbered paragraphs
elsewhere,
retaining the numbers they have in place.

--
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.

"Lene Fredborg" wrote in message
...-
ConvertNumbersToText cannot be used with the Selection object so
Selection.ConvertNumbersToText will not work.

A macro like the one below could be used to change the numbers in
the
selection only. However, it may be safer to do as Suzanne suggested,
i.e.
copy the document, change all numbers to text using
ActiveDocument.ConvertNumbersToText and then just use whatever you
need-
from-
the document.

The problem with changing only part of the numbers to text is that
this-
will-
make all subsequent numbers that belong to the same list(s) wrong -
the
subsequent numbers will act as if you have deleted the numbers that
you
converted to text. The result could be rather confusing even if you
could
undo the change at once after you copied the relevant text. Anyway,
here-
is-
the macro:

Sub ConvertNumbersInSelectionToText()

Dim oDoc As Document
Dim oRange As Range

Set oDoc = ActiveDocument
Set oRange = _
oDoc.Range(Start:=Selection.Range.Start, _
End:=Selection.Range.End)
oRange.ListFormat.ConvertNumbersToText wdNumberParagraph

Set oDoc = Nothing
Set oRange = Nothing

End Sub

--
Regards
Lene Fredborg
DocTools - Denmark
www.thedoctools.com
Document automation - add-ins, macros and templates for Microsoft
Word


"Suzanne S. Barnhill" wrote:

You can convert the numbers to text using these instructions
provided by
Stefan Blom:

To convert autonumbering (paragraph/outline numbering and LISTNUM
fields) to plain text, do the following: Make sure the active
document is the one you want to convert. Then press ALT+F11 to
display the Visual Basic Editor. On the View menu, click
Immediate Window. In the Immediate Window, type

ActiveDocument.ConvertNumbersToText

and press ENTER.

Note that if paragraph/outline numbering was applied with styles,
it isn't completely gone (CTRL+Q will bring it back!) unless you
also clear it from the style definitions.

Note that Stefan's instructions are for the entire document. I
can't-
tell-
you the appropriate macro for a selection (perhaps
Selection.ConvertNumbersToText), but perhaps someone else will
chime in-
with-
that. Alternatively, you could make a copy of the document, run
the-
macro,-
and then copy/paste the relevant bit into your good doc.

--
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.

"Monte Beery" Monte wrote in
message
...
I often need to extract a few entries from a page of numbered-
paragraphs,-
but
want to retain the original numbering for reference to the
original
document.

1. first paragraph
2. second paragraph
2.1 clause in second paragraph
3 third paragraph

Extract the second paragraph and its clause, but retain the
numbering
thus...

2 second paragraph
2.1 clause in second paragraph

Word will routinely renumber the lines...

1 second paragraph
1.1 clause in second paragraph

How do I achieve my goal of retaining the numbering when I extract
a-
part-
of
a numbered list?

Thanks for your assistance,
Monte

-

--





--
Henk57





  #11   Report Post  
Posted to microsoft.public.word.docmanagement
Stefan Blom Stefan Blom is offline
external usenet poster
 
Posts: 8,428
Default Retain numbering when extracted from list

But the tab stop after the number should be retained when pasting as
unformatted text, which means that you could then simply apply a style with
a hanging indent to the pasted items.

--
Stefan Blom
Microsoft Word MVP



"E. Robinson" E. wrote in message
...
This is not exactly true.

If you past as text it looses formatting such as hanging indents. I use
this feature to add comments to reports and need to retain all the
formatting. This is possible using the first method.

"Suzanne S. Barnhill" wrote:

Of course. This would be the simplest solution of all. Sometimes we don't
see the forest for the trees.

--
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.

"Henk57" wrote in message
...

FWIW, when I select an item from a numbered list (Word 2003), and
copy/paste it as unformatted text (via Paste Special) in the body text,
the text pasted includes the original number, but of course formatted
as
text, not as numbered list anymore. Isn't that what Monte needs, or do
I misunderstand the question? Or do I have an obscure setting that
brings this about?

'Monte Beery[_2_ Wrote:
;2228143']My thanks to both Lene and Suzanne! Both responses were on
point. I will
add Lene's macro to my collection and share with others. I continue
to
be
amazed at the expertise and generosity of the user community!

"Lene Fredborg" wrote:
-
Suzanne, that is also how I understood the OP so I may have expressed
myself
unclear. What I meant was: you can change the numbers in the
selection
using
the macro, copy the text (that is still selected), then undo to bring
the
numbers back. However, I just imagined that one could be confused by
the mix
of numbers in the meantime and then by mistake do something wrong.

But there may be an easy and, hopefully, safe way: below is the macro
in an
extended version. The macro changes the numbers in the selection to
normal
text, copies the selection and undoes the change (i.e. reverts the
numbers
back). The user then only needs to 1) select the desired text, 2) run
the
macro and 3) paste the already copied text (with the fixed numbers)
into the
relevant place.

Sub ConvertNumbersInSelectionToText_CopyText()

Dim oDoc As Document
Dim oRange As Range

Set oDoc = ActiveDocument
Set oRange = _
oDoc.Range(Start:=Selection.Range.Start, _
End:=Selection.Range.End)
oRange.ListFormat.ConvertNumbersToText wdNumberParagraph
'Copy the selection while numbers are converted
Selection.Copy
'Then undo so that numbers revert to the original
oDoc.Undo

Set oDoc = Nothing
Set oRange = Nothing
End Sub

--
Regards
Lene Fredborg
DocTools - Denmark
www.thedoctools.com
Document automation - add-ins, macros and templates for Microsoft
Word


"Suzanne S. Barnhill" wrote:
-
I don't *think* the OP wants to freeze the numbers on part of a list
in
place but rather to be able to "quote" these numbered paragraphs
elsewhere,
retaining the numbers they have in place.

--
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.

"Lene Fredborg" wrote in message
...-
ConvertNumbersToText cannot be used with the Selection object so
Selection.ConvertNumbersToText will not work.

A macro like the one below could be used to change the numbers in
the
selection only. However, it may be safer to do as Suzanne suggested,
i.e.
copy the document, change all numbers to text using
ActiveDocument.ConvertNumbersToText and then just use whatever you
need-
from-
the document.

The problem with changing only part of the numbers to text is that
this-
will-
make all subsequent numbers that belong to the same list(s) wrong -
the
subsequent numbers will act as if you have deleted the numbers that
you
converted to text. The result could be rather confusing even if you
could
undo the change at once after you copied the relevant text. Anyway,
here-
is-
the macro:

Sub ConvertNumbersInSelectionToText()

Dim oDoc As Document
Dim oRange As Range

Set oDoc = ActiveDocument
Set oRange = _
oDoc.Range(Start:=Selection.Range.Start, _
End:=Selection.Range.End)
oRange.ListFormat.ConvertNumbersToText wdNumberParagraph

Set oDoc = Nothing
Set oRange = Nothing

End Sub

--
Regards
Lene Fredborg
DocTools - Denmark
www.thedoctools.com
Document automation - add-ins, macros and templates for Microsoft
Word


"Suzanne S. Barnhill" wrote:

You can convert the numbers to text using these instructions
provided by
Stefan Blom:

To convert autonumbering (paragraph/outline numbering and LISTNUM
fields) to plain text, do the following: Make sure the active
document is the one you want to convert. Then press ALT+F11 to
display the Visual Basic Editor. On the View menu, click
Immediate Window. In the Immediate Window, type

ActiveDocument.ConvertNumbersToText

and press ENTER.

Note that if paragraph/outline numbering was applied with styles,
it isn't completely gone (CTRL+Q will bring it back!) unless you
also clear it from the style definitions.

Note that Stefan's instructions are for the entire document. I
can't-
tell-
you the appropriate macro for a selection (perhaps
Selection.ConvertNumbersToText), but perhaps someone else will
chime in-
with-
that. Alternatively, you could make a copy of the document, run
the-
macro,-
and then copy/paste the relevant bit into your good doc.

--
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.

"Monte Beery" Monte wrote in
message
...
I often need to extract a few entries from a page of numbered-
paragraphs,-
but
want to retain the original numbering for reference to the
original
document.

1. first paragraph
2. second paragraph
2.1 clause in second paragraph
3 third paragraph

Extract the second paragraph and its clause, but retain the
numbering
thus...

2 second paragraph
2.1 clause in second paragraph

Word will routinely renumber the lines...

1 second paragraph
1.1 clause in second paragraph

How do I achieve my goal of retaining the numbering when I extract
a-
part-
of
a numbered list?

Thanks for your assistance,
Monte

-

--




--
Henk57





Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Inserting tables that can later be extracted to a separate doc R Nelson Tables 1 August 23rd 06 09:47 PM
Switches in Table of Authorities - retain formatting does not retain character styles Charles Kenyon Formatting Long Documents 1 March 28th 06 10:06 AM
Numbering items, but not a list twistedsw Microsoft Word Help 1 January 31st 06 08:54 PM
Returning extracted chapter (revised) back into parent document (and endnotes) DSG Microsoft Word Help 0 October 27th 05 07:53 PM
numbering list is not followed automatically viken Microsoft Word Help 3 April 28th 05 09:23 AM


All times are GMT +1. The time now is 05:32 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"