View Single Post
  #6   Report Post  
Posted to microsoft.public.word.pagelayout
Rick[_4_] Rick[_4_] is offline
external usenet poster
 
Posts: 25
Default insert tab stop from this point forward

Fabulous; thank you. I'm trying to teach myself about
the Range object. How would I set a tab stop for the
current Section only (rather than the rest of the
document)? Do I still use Range for that?

In article ,
says...
This is kind of clumsy about getting the tab stop position, and you could
also ask the user for the alignment and leader type, but you get the idea...

Sub SetTabStopToEndOfDoc()
Dim strStop As String
Dim nStop As Single
Dim oRg As Range

strStop = InputBox("Position of tab stop in inches:")
If Len(strStop) 0 Then
nStop = CSng(Val(strStop))
If nStop 0 Then
Set oRg = Selection.Range
oRg.End = ActiveDocument.Range.End
oRg.Paragraphs.TabStops.Add _
Position:=InchesToPoints(nStop), _
Alignment:=wdAlignTabLeft, _
Leader:=wdTabLeaderSpaces
Set oRg = Nothing
End If
End If
End Sub