View Single Post
  #5   Report Post  
Posted to microsoft.public.word.pagelayout
Jay Freedman Jay Freedman is offline
external usenet poster
 
Posts: 9,854
Default insert tab stop from this point forward

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

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.

Rick wrote:
Sorry -- I really meant to ask how to do this in VBA code -- should
have posted in the VBA forum...

On May 22, 4:00 pm, Rick wrote:
Thanks; that does it. Is there an easy way to then return to where I
was before pressing Ctrl+Shift+End?

On May 19, 4:45 pm, "Jay Freedman" wrote:



Rick wrote:
I have text in my document below where my cursor is. How do I
create a tab stop that will be set for the rest of the document
forward? I know if I just enter a tab stop normally, it won't be
in effect for any text below my cursor position. Thanks.


Select all of the text where you want the tab stop to be set (most
easily by pressing Ctrl+Shift+End) and then set the tab stop.