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 2007

Tip: Looking for answers? Try searching our database.

retrieve tabstop index for paragraph

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
LostInMD - 24 Jan 2007 22:32 GMT
Hi All,

I am moving through a document and am looking for custom tabstops.  I do not
want to use an intCtr to track how many tabstops there are per paragraph.  
Once I find a custom tabstop, I do want to know its index w/in the tabstops
for the paragraph.  I also want the the start and end value for the tab stop
(horizontal position).  Thanks in advance for any information you can offer!

I am using the following logic to find the custom tabstops:

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
Jezebel - 25 Jan 2007 07:58 GMT
1. What's the question?

2. Why are you doing this? Presumably you don't want to find custom tab
stops simply for the sake of doing so.

3. What's an 'intCtr' ?

> Hi All,
>
[quoted text clipped - 20 lines]
>
> MsgBox sTmp
LostInMD - 25 Jan 2007 13:41 GMT
1.  How do I retreive the start and end horizontal position for the custom
tab stop?  How do I retrieve it's index position w/in the tabstop collection
for the paragraph it is in?

2.  I am doing this so that:  I can replace the custom tabstop with a number
of characters (depending on the type of custom tab stop:  periods for period
fill, hyphens for hyphen fill, underline for underbar fill) that span the
width of the original tabstop (thus the need for the start and end position
so that I can begin inserting my substitute characters at the start of the
tabstop using it's start horizontal position and stop inserting my substitute
characters at the end of the tabstop using the tabstop's end horizontal
position.

3.  An intCtr is a variable name for a counter.  I do not want to use an
intCtr to track which tabstop I'm on it the tabstop collection, since I will
be deleting tabstops w/in the collection as I move along.  The intCtr, after
the first tabstop deletion, would become inaccurate for looping through the
tabstop collection of the paragraph collection for the Word document.

I hope these answers helped to clarify what I'm trying to do.  Please do not
hesitate to ask more question!  Thanks in advance for any suggestions you can
offer!

> 1. What's the question?
>
[quoted text clipped - 27 lines]
> >
> > MsgBox sTmp
Jezebel - 26 Jan 2007 05:56 GMT
Put your proposed method aside for the moment, and just explain what you
want to end up with (not how you think you might go about it).

> 1.  How do I retreive the start and end horizontal position for the custom
> tab stop?  How do I retrieve it's index position w/in the tabstop
[quoted text clipped - 62 lines]
>> >
>> > MsgBox sTmp
LostInMD - 30 Jan 2007 20:02 GMT
My end product would be removing all leader fill via custom tab stops from
the document and replacing them with periods, hyphens, or underlines that
appear to be the same length (take up the same amount of space) as the
original leader fill custom tab stop.  Thanks again for your help!

> Put your proposed method aside for the moment, and just explain what you
> want to end up with (not how you think you might go about it).
[quoted text clipped - 65 lines]
> >> >
> >> > MsgBox sTmp
 
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.