Re: How to find the bottom of a table in VBA
- From: scottw <scottw@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 28 Mar 2006 06:13:02 -0800
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,the
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
left of my image table. Since the desired width of my next text row isalso
just to the left of my image table, I thought I could get thenext
'wdHorizontalPositionRelativeToPage' and use it to set the width of my
row. However the number I get back is always the same (my right margin)bottoms
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
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 |
----------------------- |wrap
|
(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
*vertical*text around pictures without you making a complex table.
Apart from that I don't understand what you mean when you say the
theseposition 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 myreports,
with text on the left.
I currently use a table positioned to the right margin for placing
text.images. I then fill other tables positioned on the left margin with
passAll 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
thethe
bottom of the image table, but am finding it very difficult to get theneeded
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
thathopes of finding out it's wdVerticalPositionrelativePage, but thisactually
consistantly gives the right margin (even when I see the bookmark is
3 inches to the left!) It seems word is measuring from an assumption
my
bookmark is right justified so it must be on the margin.)
- Follow-Ups:
- Re: How to find the bottom of a table in VBA
- From: Tony Jollans
- Re: How to find the bottom of a table in VBA
- References:
- How to find the bottom of a table in VBA
- From: scottw
- Re: How to find the bottom of a table in VBA
- From: Tony Jollans
- Re: How to find the bottom of a table in VBA
- From: scottw
- Re: How to find the bottom of a table in VBA
- From: Tony Jollans
- How to find the bottom of a table in VBA
- Prev by Date: Re: Word mutti-session handling within VBA
- Next by Date: Re: How to find the bottom of a table in VBA
- Previous by thread: Re: How to find the bottom of a table in VBA
- Next by thread: Re: How to find the bottom of a table in VBA
- Index(es):
Relevant Pages
|