Lines numbers fixed in position? Paragraphs numbers?

J

John

Hi guys,

I posted this question not long ago but I must have been unclear because
the replies were fixing a different problem.

I have WinXP with Word 2003. I set LINE NUMBERING on (in the LAYOUT tab
of PAGE SETUP).

Is there a way to make line numbering fixed such that each line with a
particular line number retains that line number even if the line is
moved from one place to another in the document during editing?

---

Alternatively, how can I number the paragraphs such that if I move the
paragraphs around during document editing, the paragraphs retain their
paragraph number.

Maybe I can start with auto paragraph numbering and then convert those
variable numbers into fixed text? But how do I later remove the numbers
embedded in the text?

John
 
T

Terry Farrell

No. The line numbering is just a simple numbering of the lines in physical
order. It isn't like section/paragraph numbers that can be moved.
 
D

Daiya Mitchell

Auto-numbering is designed to automatically update as you re-order text.
That's the point of it.

If the numbers aren't going to change, just type them in manually.

If they might change while you are originally composing, but then you
want them to stay the same after the first draft, you could use Word's
auto numbers and then run a macro to convert them to plain text. Or a
post suggests that Copy and Paste Special | Paste as Unformatted Text
converts the numbers to plain text.

Macro and instructions provided by MVP Stefan Blom--I would do this on a
COPY:

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

Klaus Linke

Hi John,

You could add your own numbered bookmarks for all the lines.
The macro below does that. It should work in simple cases, though not if you suppressed numbering for some paragraphs or styles, or if you don't restart numbering on each page...
The bookmarks all have the form myPXX_LYY where XX is the (adjusted) page number, and YY is the line number.
If you're done, you can delete all bookmarks starting with "my" using the second macro.

Regards,
Klaus

Sub myBookmarksLineNumbers()
Dim myLine As Line
Dim myPage As Page
Dim sBookmarkNamePage As String
Dim sBookmarkNameLine As String

For Each myPage In ActiveDocument.ActiveWindow.Panes(1).Pages
sBookmarkNamePage = "myP" & myPage.Rectangles(1).Range.Information(wdActiveEndAdjustedPageNumber)
For Each myLine In myPage.Rectangles(1).lines
sBookmarkNameLine = "L" & myLine.Range.Information(wdFirstCharacterLineNumber)
ActiveDocument.Bookmarks.Add _
Name:=sBookmarkNamePage & "_" & sBookmarkNameLine, _
Range:=myLine.Range
Next myLine
Next myPage
End Sub

Sub myBookmarksDelete()
Dim myBookmark As Bookmark
For Each myBookmark In ActiveDocument.Bookmarks
If left(myBookmark.Name, 2) = "my" Then
myBookmark.Delete
End If
Next myBookmark
End Sub
 

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