Read Tabstops Manually applied to a paragraph

T

Tim

I want to read only the tabstops that have been manually applied
to a paragraph (Not tab stops in the style or the default tab stops).
Both of the following reads default tab settings.

Greatly appreciate all Help.


Sub ReadTabs1()
Dim sTmp As String, i As Integer, Para As Paragraph
Set Para = Selection.Paragraphs(1)
For i = 1 To Para.TabStops.Count
sTmp = sTmp & CStr(Para.TabStops(i).Position / 72) & _
": " & CStr(Para.TabStops(i).Position) & vbCrLf
Next
MsgBox sTmp
End Sub

Sub ReadTabs2()
Dim sTmp As String, tb As TabStop, Para As Paragraph
Set Para = Selection.Paragraphs(1)
For Each tb In Para.TabStops
sTmp = sTmp & CStr(tb.Position / 72) & _
": " & CStr(tb.Position) & vbCrLf
Next
MsgBox sTmp
End Sub
 
D

Dave Lett

Hi Tim,

You might try the following:

Dim sTmp As String, tb As TabStop, Para As Paragraph
Set Para = Selection.Paragraphs(1)
For Each tb In Para.TabStops
If tb.CustomTab Then
sTmp = sTmp & CStr(tb.Position / 72) & _
": " & CStr(tb.Position) & vbCrLf
End If
Next

MsgBox sTmp

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