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
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 Be...@discussions.microsoft.com> wrote in message
news:38B1B6BB-828C-471B...@microsoft.com...
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
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" <l...@REMOVETHISthedoctools.com> wrote in message
news:900F20D0-373E-4B48...@microsoft.com...
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
--
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" <l...@REMOVETHISthedoctools.com> wrote in message
news:F8720238-C612-483A...@microsoft.com...
'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:
> -
> -
> 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" l...@REMOVETHISthedoctools.com wrote in message
> news:900F20D0-373E-4B48...@microsoft.com...-
> 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-
> 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 Be...@discussions.microsoft.com wrote in
> message
> news:38B1B6BB-828C-471B...@microsoft.com...
> 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
--
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" <Henk57...@officefrustration.com> wrote in message
news:Henk57...@officefrustration.com...
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.
--
Stefan Blom
Microsoft Word MVP
"E. Robinson" <E. Robi...@discussions.microsoft.com> wrote in message
news:A72F7868-A2B5-4F90...@microsoft.com...