[mso] Re: Highlight lines in Word (2000) through entire document?
- From: "Tillotson, Robert N (US SSA)" <robert.tillotson@xxxxxxxxxxxxxx>
- To: <mso@xxxxxxxxxxxxx>
- Date: Wed, 27 Feb 2008 20:22:25 -0500
Robert,
You can try these macros. Haven't had time to check all the possible document
interactions. Paste into the This Document Module.
Sub HiLite()
Dim myRange As Range
Dim myLines As Long
Dim i As Long
Application.ScreenUpdating = False
With ActiveDocument.Bookmarks
.Add Range:=Selection.Range, Name:="FirstBM"
.DefaultSorting = wdSortByName
.ShowHidden = False
End With
i = GetAbsoluteLineNum(Selection.Range)
Selection.GoTo what:=wdGoToLine, which:=wdGoToLast
myLines = GetAbsoluteLineNum(Selection.Range)
Selection.GoTo what:=wdGoToBookmark, Name:="FirstBM"
Do While i < myLines
Selection.EndKey Unit:=wdLine, Extend:=wdExtend
Debug.Print Selection.Text
Set myRange = ActiveDocument.Range(Start:=Selection.Start, End:=Selection.End)
myRange.HighlightColorIndex = wdYellow
Selection.HomeKey Unit:=wdLine
Selection.MoveDown Unit:=wdLine, Count:=3
i = i + 3
Loop
Selection.GoTo what:=wdGoToBookmark, Name:="FirstBM"
Application.ScreenUpdating = False
End Sub
Function GetAbsoluteLineNum(r As Range) As Integer
Dim i1 As Integer, i2 As Integer, Count As Integer, rTemp As Range
r.Select
Do
i1 = Selection.Information(wdFirstCharacterLineNumber)
Selection.GoTo what:=wdGoToLine, which:=wdGoToPrevious, Count:=1,
Name:=""
Count = Count + 1
i2 = Selection.Information(wdFirstCharacterLineNumber)
Loop Until i1 = i2
r.Select
GetAbsoluteLineNum = Count
End Function
Robert Tillotson
BAE-IT Lead Field Technician
Groton field Office
860-441-2207
860-670-7624 Blackberry
________________________________
From: mso-bounce@xxxxxxxxxxxxx on behalf of Robert Carneal USA
Sent: Wed 02/27/2008 03:49 PM
To: mso@xxxxxxxxxxxxx
Subject: [mso] Highlight lines in Word (2000) through entire document?
Hello. When I search for _*Highlight Lines In Word 2000*_, most of my
hits are for Excel, which explains how to highlight rows. In this case,
I would like to make every third line highlight simply for easier
reading. Can this be done for an entire document in Word 2000 without
having to do it manually for 37 pages?
Thanks.
Robert
*************************************************************
You are receiving this mail because you subscribed to mso@xxxxxxxxxxxxx or
MicrosoftOffice@xxxxxxxxxxxxxxxx
To send mail to the group, simply address it to mso@xxxxxxxxxxxxx
To Unsubscribe from this group, visit the group's homepage and use the dropdown
menu at the top. This will allow you to unsubscribe your email address or
change your email settings to digest or vacation (no mail).
http://www.freelists.org/webpage/mso
To be able to share files with the group, you must join our Yahoo sister group.
This group will not allow for posting of emails, but will allow you to join
and share problem files, templates, etc.:
http://tech.groups.yahoo.com/group/MicrosoftOffice . This group is for FILE
SHARING ONLY.
If you are using Outlook and you see a lot of unnecessary code in your email
messages, read these instructions that explain why and how to fix it:
http://personal-computer-tutor.com/abc3/v28/greg28.htm
*************************************************************
-- No attachments (even text) are allowed --
-- Type: application/ms-tnef
-- File: winmail.dat
*************************************************************
You are receiving this mail because you subscribed to mso@xxxxxxxxxxxxx or
MicrosoftOffice@xxxxxxxxxxxxxxxx
To send mail to the group, simply address it to mso@xxxxxxxxxxxxx
To Unsubscribe from this group, visit the group's homepage and use the dropdown
menu at the top. This will allow you to unsubscribe your email address or
change your email settings to digest or vacation (no mail).
http://www.freelists.org/webpage/mso
To be able to share files with the group, you must join our Yahoo sister group.
This group will not allow for posting of emails, but will allow you to join
and share problem files, templates, etc.:
http://tech.groups.yahoo.com/group/MicrosoftOffice . This group is for FILE
SHARING ONLY.
If you are using Outlook and you see a lot of unnecessary code in your email
messages, read these instructions that explain why and how to fix it:
http://personal-computer-tutor.com/abc3/v28/greg28.htm
*************************************************************
- References:
- [mso] Highlight lines in Word (2000) through entire document?
- From: Robert Carneal USA
Other related posts:
- » [mso] Highlight lines in Word (2000) through entire document?
- » [mso] Re: Highlight lines in Word (2000) through entire document?
- » [mso] Re: Highlight lines in Word (2000) through entire document?
- » [mso] Re: Highlight lines in Word (2000) through entire document?
- » [mso] Re: Highlight lines in Word (2000) through entire document?
- [mso] Highlight lines in Word (2000) through entire document?
- From: Robert Carneal USA