Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.word.newusers
Klaus Linke Klaus Linke is offline
external usenet poster
 
Posts: 413
Default Lines numbers fixed in position? Paragraphs numbers?

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(wdActiveEnd AdjustedPageNumber)
For Each myLine In myPage.Rectangles(1).lines
sBookmarkNameLine = "L" & myLine.Range.Information(wdFirstCharacterLineNumbe r)
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



"John" schrieb im Newsbeitrag ...
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

 
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
How do I correct position of page numbers in Table of Contents sdgatch Microsoft Word Help 2 July 13th 07 02:34 PM
how can I see the cursor's position in a line in numbers? Noggiebirdie Microsoft Word Help 1 July 5th 07 03:14 PM
Index using paragraphs numbers not page numbers LindaG Microsoft Word Help 1 March 25th 06 01:01 PM
Updating numbers on paragraphs Francesca Microsoft Word Help 11 April 20th 05 03:34 AM
Fixed text position Lyn Adkin via OfficeKB.com Microsoft Word Help 1 February 12th 05 11:53 PM


All times are GMT +1. The time now is 04:48 AM.

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

About Us

"It's about Microsoft Word"