I want to jump to a Tabstop in Word with VBA.
There are two Tabstops (Tab1 and Tab2) in the document.
Tab1 Tab2
Hello
The cursor is at the first character of the word Hello. Now I want to
jump to Tab1 or to Tab2.
Which code do I use in VBA?
Thanks
Selection.MoveLeft Unit:=wdWord, Count:=2 'for TAB1?

Signature
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP
My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
> I want to jump to a Tabstop in Word with VBA.
> There are two Tabstops (Tab1 and Tab2) in the document.
[quoted text clipped - 8 lines]
>
> Thanks
Hi,
Did you want to type the tab characters, or are they already there? Graham's already told you how to handle the latter. To type it,
you could use something based on
Selection.TypeText Text:=vbTab
In either case, if there's any risk that your text string will pass the first tab stop, you'll need to test for that, perhaps using
something based on a comparison of:
Selection.Information(wdHorizontalPositionRelativeToTextBoundary)
against the tab position.
Cheers

Signature
macropod
[MVP - Microsoft Word]
-------------------------
>I want to jump to a Tabstop in Word with VBA.
> There are two Tabstops (Tab1 and Tab2) in the document.
[quoted text clipped - 8 lines]
>
> Thanks