E
Ed
I'm trying to find some text in my Range, then use MoveEnd and MoveStart to
encompass everything from the end point to the beginning of the document.
To check what was happening, I selected the range and turned the text green.
All that was green was the very last paragraph mark! Can someone help me
fix this?
' Find end of TIR
Set rngTIR = rngDoc
rngTIR.Find.Execute _
FindText:="DA Form XXXX-E: "
' Move range to cover all of TIR
rngTIR.MoveEnd Unit:=wdParagraph
' If header exists, move range to include
If bolUncl = True Then
rngTIR.MoveEnd Unit:=wdParagraph, Count:=3
End If
rngTIR.MoveStart Unit:=wdStory
' *****************
' Debugging only!!
rngTIR.Select
Selection.Font.ColorIndex = wdBrightGreen
Selection.Collapse Direction:=wdCollapseEnd
If MsgBox("Is this right?", vbYesNo) = vbYes Then
Selection.Font.ColorIndex = wdAuto
End If
' *****************
encompass everything from the end point to the beginning of the document.
To check what was happening, I selected the range and turned the text green.
All that was green was the very last paragraph mark! Can someone help me
fix this?
' Find end of TIR
Set rngTIR = rngDoc
rngTIR.Find.Execute _
FindText:="DA Form XXXX-E: "
' Move range to cover all of TIR
rngTIR.MoveEnd Unit:=wdParagraph
' If header exists, move range to include
If bolUncl = True Then
rngTIR.MoveEnd Unit:=wdParagraph, Count:=3
End If
rngTIR.MoveStart Unit:=wdStory
' *****************
' Debugging only!!
rngTIR.Select
Selection.Font.ColorIndex = wdBrightGreen
Selection.Collapse Direction:=wdCollapseEnd
If MsgBox("Is this right?", vbYesNo) = vbYes Then
Selection.Font.ColorIndex = wdAuto
End If
' *****************