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 2004

Tip: Looking for answers? Try searching our database.

shift tabs for a selected paragraph?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
keith brickey - 10 Nov 2004 17:37 GMT
I need to shift all of the tabstops for a selected paragraph to the right by
a given amount, say 0.2 inches. So far all of my approaches meet with error
messages or unexpected results. Can someone suggest a way of accomplishing
this?

Thanks,

Keith
Dave Lett - 10 Nov 2004 19:31 GMT
Hi Keith,

You might be able to use something like the following:

''' declare variables
Dim iTab As Integer
Dim iPos As Integer
Dim iLeader As Integer

With Selection.Paragraphs(1)
   For iTab = .TabStops.Count To 1 Step -1
       If .TabStops(iTab).CustomTab Then
           With .TabStops(iTab)
               ''' retain current tab settings
               iLeader = .Leader
               iPos = .Position
               iAlign = .Alignment
               ''' clear the tab
               .Clear
           End With
           ''' move the position of the tab and apply
           ''' the tab settings
           .TabStops.Add _
               Position:=iPos + InchesToPoints(0.2), _
               Alignment:=iAlign, _
               Leader:=iLeader
       End If
   Next iTab
End With

HTH,
Dave
> I need to shift all of the tabstops for a selected paragraph to the right by
> a given amount, say 0.2 inches. So far all of my approaches meet with error
[quoted text clipped - 4 lines]
>
> Keith
 
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.