Re: How to find the bottom of a table in VBA



Thank you Tony (and Jezebel) for the help.

The problem that limits me is not knowing the size in advance for any of
these tables, so putting an image in one of them would only solve the problem
if the image was just right for that table.

I'm convinced that you are right about the difficulty of this, still
looking for the alternative method though. The users of these reports are
very picky about style things like font type, size and color and the styles
vary greatly, even from table to table (and cell to cell) within one report.
Having the tables also gives non tech users an interface for laying out
those styles, etc.

The only way I could imagine to replace these tables would be having VB read
each table's style properties then remove the table and type the contents
back. But, since hundreds of these templates already exist, and contents
come from a mix of code and the tables themselves - this code would need to
be able to read the code modules of these templates at the same time!

It seems so much more reasonable to have a function that would simply add
rows whos widths were based on the left edge of the pre-placed image tables
to the right. I could then simply replace any code that puts text into a
cell with a call to this function, and the function would minimize the
area between the text row ends and the images.

If only that right justified cursor could tell me its real vertical
position! That way I could know exactly what the right edge of my text area.
Instead it tells me the right margin of the page.

Thanks for the efforts,

Scott

"Tony Jollans" wrote:

You are attempting something rather difficult but, more importantly, you are
trying to outdo Word. I suspect that you will come to grief sooner or later
with this and really would encourage you to find an alternative method.

If you have to use the text tables, what about the images? Couldn't they be
placed inside the text table so that text could flow round them within the
table cells - or do the images really need to line up with each other rather
than any related text?

--
Enjoy,
Tony

"scottw" <scottw@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:2BC87079-6CAA-441B-AFEA-24284DC4E3ED@xxxxxxxxxxxxxxxx
To stat, thank you for your time Tony,

As to why the tables, it is because there are many templates in place and
they have the text tables already, each with potentially varied fonts and
formats, so they are not avoidable.

For the vertical position - yes - my bad, I do mean horizontal. This is
what I intended to do:

I noticed that if I selected the line of text just below my text table and
right justifying that line, it would automatically be positioned just to
the
left of my image table. Since the desired width of my next text row is
also
just to the left of my image table, I thought I could get the
'wdHorizontalPositionRelativeToPage' and use it to set the width of my
next
row. However the number I get back is always the same (my right margin)
whether I have an image table or not on the right.

Initially I though I would make a 'map' from the bottoms and widths of the
image tables and contour my text rows to that map, but finding the
bottoms
of the tables has also eluded me.

I will attempt to show the layout, I hope the spacing translates!
| | |
|
| | | IMAGE TABLE ONE
|
| | | (WIDE)
|
|
| ---------------------------------------------- |
| | --> --> |
|
| TEXT TABLE | WANT TO --> | IMAGE TABLE |
| | WIDEN ROW --> | TWO |
| | TO USE THIS SPACE |
|
----------------------- |
|
(NEXT LINE) (RIGHT JUSTIFIED CUSOR) ^ | |

Thanks again


"Tony Jollans" wrote:

Hi scottw,

Is there a reason you're using tables for your text? Word will happily
wrap
text around pictures without you making a complex table.

Apart from that I don't understand what you mean when you say the
*vertical*
position gives you the right margin - a horizontal measurement.

--
Enjoy,
Tony

"scottw" <scottw@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:A3DC7FA1-3E3F-41E5-A47C-92A62FE87A30@xxxxxxxxxxxxxxxx
From template code I need to place images along the right side of my
reports,
with text on the left.

I currently use a table positioned to the right margin for placing
these
images. I then fill other tables positioned on the left margin with
text.
All the tables are of varied length, filled from text read from files.

I would like to widen the rows in the text tables once they safetly
pass
the
bottom of the image table, but am finding it very difficult to get the
needed
information from the 'Range.information' object.

If anyone has any solutions for this it would be greatly appreciated.

Thank you in advance.

Additional info-
Version: word 2003
Have tried placing a 'right justified' bookmark under each table in
the
hopes of finding out it's wdVerticalPositionrelativePage, but this
consistantly gives the right margin (even when I see the bookmark is
actually
3 inches to the left!) It seems word is measuring from an assumption
that
my
bookmark is right justified so it must be on the margin.)






.



Relevant Pages

  • How to avoid page break
    ... I am currently creating templates in MS Word 2003, ... Margin all = 1cm ... 1st Cell height = 8.9cm ... Give me a clue ...
    (microsoft.public.word.application.errors)
  • Re: Inserting a picture
    ... We do tend to forget about cell margins as long as we're ... Word MVP FAQ site: http://word.mvps.org ... scanned the picture as a jpg. ... margin. ...
    (microsoft.public.word.docmanagement)
  • Re: Any solution suggestion to this complex macro problem?
    ... of workbooks, it is simply opening the two workbooks, looping through the ... > templates are identical in terms of structure and consist of 15 Sheets ... > template comparing cell value is less then the old one but this time the ...
    (microsoft.public.excel.programming)
  • Re: Table cell margin value
    ... Alex St-Pierre nous racontait que: ... I'm looking to understand the cell width in a table. ... margin between text and column line than Excel. ... is the exact margin Word use ?? ...
    (microsoft.public.word.vba.general)
  • Re: Inserting a picture
    ... Also make sure that the paragraph formatting in the cell ... But I want to insert a picture in one of those ... margin. ...
    (microsoft.public.word.docmanagement)