Trouble with Tables

B

Brett Grant

I am using Word2000. I have a document with multiple tables. All of
the tables have 10 columns and the exact same table header. In column
7 is a classification for that row. There are 4-7 possible
classifications. I have an order of precedence for the
classifications, so after I decide which classification applies to the
page, I need to put it in the page header & footer and underneath the
bottom line of the table on the page.

The problem that I have is with the tables. In order to fit all of
the information in the document, the tables are allowed to break
across pages and each row is autosized. The first column generally
only has one word in it, while the second and third can have 1 to
pages worth of words in them. This means that if a row is broken,
column 1 is often completly empty on the next page. Column 2 can also
be empty.

I wrote some code that loops through each row of a table. It figures
out what the classification should be no problem. What I can not
figure out is how to place the text below the table. If the table is
longer than a page, I wanted to place a textbox with the
classification just a bit under the lower margin, except on the last
page. On the last page I wanted to place it a little bit below the
last line. I used:

set range = activedocument.goto wdgotopage,wdgotoabsolute,pagenumber

to get to the page that I want to work on. This works great on the
first page of the table where it picks the break to define the range,
but on the following pages it picks the first column with text in it,
which is generally the 2nd or 3rd columns. This places the textbox in
variable locations.

I also tried to find the last cell on the page and anchor the textbox
to that, but because the rows are allowed to break, the last cell is
in a variable location and then I have the same problem as above. The
header row is always in the same place, but I can not figure out how
to access that. I suspect that it cannot be used. The other issue of
anchoring to a cell is that it chances the layout of the text in the
cell.

What I need is a command that would allow me to place a textbox at a
certain position on a page that I specify, but since there are no page
objects, I can not figure out how to do this.

Any other ideas? I hope that I have explained the problem
sufficently. Feel free to ask further questions.

Thanks,
Brett
 
D

Doug Robbins - Word MVP

Hi Brett,

I haven't got my mind completely around what your doing, but can you use the
..Range of the "\page" bookmark.

Dim myrange As Range
Set myrange = ActiveDocument.Bookmarks("\page").Range.Tables(1).Range
myrange.End = myrange.End + 1
myrange.InsertAfter "Classification"

will insert the word "Classification" immediately below the table on the
page.

Please respond to the newsgroups for the benefit of others who may be
interested.

Hope this helps
Doug Robbins - Word MVP
 

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