E
Ebbe
Hey!
I need to write some right justified text immediately followed by some left
justified text (not confused with some centered text).
Am I right when I say, that it isn't possible to place two tab stops nearer
each other than 2 points?
If I run the following piece of code with x = 1, the 2nd tab stop is
overwriting the 1st tab stop.
But if x = 2 the code produces 2 tab stops.
How can I place the 2 tab stops as near as possible?
Ebbe
---------------------------------------------------------------------------------
Sub TabTest()
Dim TabPosition As Long
Dim x As Long
TabPosition = 200
x = 1
Selection.ParagraphFormat.TabStops.ClearAll
Selection.ParagraphFormat.TabStops.Add _
Position:=TabPosition, _
Alignment:=wdAlignTabRight, _
Leader:=wdTabLeaderSpaces
Selection.TypeText Text:=vbTab
Selection.TypeText "Right jystified text"
TabPosition = TabPosition + x
Selection.ParagraphFormat.TabStops.Add _
Position:=TabPosition, _
Alignment:=wdAlignTabLeft, _
Leader:=wdTabLeaderSpaces
Selection.TypeText Text:=vbTab
Selection.TypeText "Left jystified text"
Selection.TypeParagraph
End Sub
---------------------------------------------------------------------------------
I need to write some right justified text immediately followed by some left
justified text (not confused with some centered text).
Am I right when I say, that it isn't possible to place two tab stops nearer
each other than 2 points?
If I run the following piece of code with x = 1, the 2nd tab stop is
overwriting the 1st tab stop.
But if x = 2 the code produces 2 tab stops.
How can I place the 2 tab stops as near as possible?
Ebbe
---------------------------------------------------------------------------------
Sub TabTest()
Dim TabPosition As Long
Dim x As Long
TabPosition = 200
x = 1
Selection.ParagraphFormat.TabStops.ClearAll
Selection.ParagraphFormat.TabStops.Add _
Position:=TabPosition, _
Alignment:=wdAlignTabRight, _
Leader:=wdTabLeaderSpaces
Selection.TypeText Text:=vbTab
Selection.TypeText "Right jystified text"
TabPosition = TabPosition + x
Selection.ParagraphFormat.TabStops.Add _
Position:=TabPosition, _
Alignment:=wdAlignTabLeft, _
Leader:=wdTabLeaderSpaces
Selection.TypeText Text:=vbTab
Selection.TypeText "Left jystified text"
Selection.TypeParagraph
End Sub
---------------------------------------------------------------------------------