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 / January 2005

Tip: Looking for answers? Try searching our database.

Problems with a right tab stop immediatly followed by a left tab stop.

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ebbe - 26 Jan 2005 18:59 GMT
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

---------------------------------------------------------------------------------
Klaus Linke - 27 Jan 2005 01:10 GMT
Hi Ebbe,

> Am I right when I say, that it isn't possible to place two tab
> stops nearer each other than 2 points?

Looks like it. Probably, it would get confusing if tab stops could sit right on
top of one another.

Perhaps you might use a table instead (right-align in one cell, left-align in
the next, and set the table margins to zero)?

Regards,
Klaus
Ebbe - 27 Jan 2005 05:13 GMT
Hey Klaus.

It could be a possible solution, if it was not for the reason, that I cannot
use it in my case.
The tab stops can be different from line to line.
I would have to create an awful lot of tables.
I receive commands from a source with information about position, alignment
and contents, and from that I produce a document.

Ebbe

> Hi Ebbe,
>
[quoted text clipped - 11 lines]
> Regards,
> Klaus
Klaus Linke - 27 Jan 2005 06:10 GMT
> It could be a possible solution, if it was not for the reason, that I
> cannot use it in my case.

I'm afraid you'll have to put up with the 2pt space then.
At least I'm out of ideas...

Klaus
Ebbe - 27 Jan 2005 16:36 GMT
Hey Klaus.

I have already done that.
My hope was, that some knew a better way to solve the problem.

But thank you fore trying ;-)

Ebbe

>> It could be a possible solution, if it was not for the reason, that I
>> cannot use it in my case.
[quoted text clipped - 3 lines]
>
> Klaus
 
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.