shift tabs for a selected paragraph?

K

keith brickey

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
 
D

Dave Lett

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top