how do I copy a section of a word document including line numbers

G

Guest

Hi,

I'm trying to copy a section of a word document into another word document.
The problem is I want to transfer the original line numbers into the new
document.
i.e. copy lines 586 - 597 and when I insert/paste into the new document they
are still numbered 586-597 as per the original formatting and numbering.

Is this possible? I'm using Word 2002

Many thanks
 
J

Jay Freedman

You can't do it automatically.

After you copy and paste the material to the new document, you need to open
File > Page Setup > Layout > Line Numbers and manually enter the starting
number that matches the number in the original document (e.g., 586).

If you have multiple segments like this, with or without unnumbered segments
around them, you'll have to separate them with section breaks -- an entire
section must be numbered or unnumbered.

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 
G

Guest

Jay,

Thanks for that, not really what I wanted to hear as I'll have dozens of
entries to have to fromat, some will have the same numbering as previous
entries as I am taking sections from six different word documents :blush:( ... oh
well .. who needs sleep anyway :blush:)
 
J

Jay Freedman

I shouldn't have left out an alternative: a macro to help with the
job. Use the information at http://www.gmayor.com/installing_macro.htm
to set up this macro, and assign a button or keystroke to run it:

Sub InsertLineNumberedSection()
' Assumes text is on the clipboard
' and will be inserted -- surrounded by
' continuous section breaks -- and assigned
' line numbers starting with a user-supplied
' value.

Dim startNum As String

With Selection
' Make sure the selection isn't extended
.Collapse wdCollapseEnd

' Insert two continuous section breaks at the
' current cursor location
.InsertBreak Type:=wdSectionBreakContinuous
.InsertBreak Type:=wdSectionBreakContinuous

' Back up to the point between them
.Move unit:=wdCharacter, Count:=-1

' Insert clipboard contents
.Paste

' Get the starting number
startNum = InputBox$(Prompt:="Starting number:", _
Title:="Line Numbers", Default:="1")

' Assign the line number format
With .Sections(1).PageSetup.LineNumbering
.Active = True
.StartingNumber = Val(startNum)
.CountBy = 1
.RestartMode = wdRestartContinuous
End With

End With
End Sub

This will put in the section breaks at the current cursor location,
paste from the clipboard (assuming you've already copied the text you
want to insert), and pop up a box asking what line number to start at.

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.
 

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