How do I determine current column and lines left in column?

J

Joe_Canby

Any ideas how I can determine 1) which column I'm currently in and 2) how
many lines are left from the insertion point to the bottom of the column/top
of the next column. I'm using VB6 with Word to dynamically (no template)
create a three (3) column/ two(2) page legal size layout that will be used
for a folding brochure. I'm populating the columns from an ADO recordset.
Depending on the data, I may need to insert special messages at the
bottom/top of any column. For example I may need to insert a literal string
message at the bottom of a column if the text in that column meets certain
criteria.

Any help would be appreciated. Hopefully this hasn't been too confusing of
a post.
 
J

Jezebel

Col = selection.Information(wdEndOfRangeColumnNumber)
Row = selection.Information(wdFirstCharacterLineNumber)
 
J

Joe_Canby

Thanks for the response. I just tried these and I'm not getting back the
results I expected. I think these will work on table columns but I'm trying
to find out location within TextColumns on a page. I do think that these may
work if I can figure out how to establish a range for the scope of each text
column. Any ideas?

Thanks again.

Joe
 
A

Ashish

I am facing the same problem.
I have looked wherever I can but I just can't find a reliable way of
checking which textcolumn am I, in the code. I have also tried the
Information(wdHorizontalPositionRelativeToPage),which unforunately just about
anywhere gives me a -1, no reason at all. EVEN WHEN I HAVE ONLY A SINGLE LINE
selected. 100% zoom in page view is the default. Next try has been the
distancefromright and left in the hope of getting the position wrt to the
page end. No help again.
Is there a reliable way of knowing the current textcolumn of the
cell/range/row/selection/insertion point?
Thanks.
 
B

Bob S

I am facing the same problem.
I have looked wherever I can but I just can't find a reliable way of
checking which textcolumn am I, in the code. I have also tried the
Information(wdHorizontalPositionRelativeToPage),which unforunately just about
anywhere gives me a -1, no reason at all.

To find the column containing the Selection, try this:

Dialogs(wdDialogFormatColumns).ColumnNo

Bob S
 

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