Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / November 2007

Tip: Looking for answers? Try searching our database.

Tabstop Word2000 VBA

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
w.heijnen@vixia.nl - 19 Nov 2007 07:41 GMT
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
Graham Mayor - 19 Nov 2007 08:51 GMT
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
macropod - 19 Nov 2007 09:42 GMT
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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.