Dear Experts:
I need to retrieve the value of the left tabstop (there is only one
left tabstop) setting of a custom defined style and use this value in
a macro that sets the left tabstop for certain sections.
I got no idea how I can retrieve this information. Help is
appreciated. Thank you very much in advance.
Regards, Andreas
Sub SetTabStops()
Dim i As Integer
Dim sect As Section
For i = 2 to 3
Set sect = ActiveDocument.Sections(i)
With sect.Headers(wdHeaderFooterFirstPage)
.LinkToPrevious = False
.Range.ParagraphFormat.tabstops.ClearAll
.Range.ParagraphFormat.tabstops.Add _
Position:=CentimetersToPoints(VALUE OF THE LEFT TAB SETTING OF A
CUSTOM DEFINED HEADER STYLE IS TO BE FILLED IN HERE),
alignment:=wdAlignTabLeft, Leader:= wdTabLeaderSpaces
End With
next i
End Sub
Brian - 04 Jul 2007 14:14 GMT
I found this code that reads the tab settings then writes them to a message
box.
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
Use the sTmp to set the tab position.
Hope this helps.

Signature
Brian McCaffery
> Dear Experts:
>
[quoted text clipped - 26 lines]
> next i
> End Sub