Thread: Page total
View Single Post
  #4  
Old May 5th, 2004, 08:40 AM
Cindy M -WordMVP-
external usenet poster
 
Posts: n/a
Default Page total

Hi Maranello,

The problem is that my table with data can
grow up to several pages. What is the best thing to do? Create a VBA
procedure that makes a field in the footer? In this field I could place
a large VBA statement with refers to the last cell of the table on that
page? But how do I know what the last cell on every page is? Can this
be done without looping through the table?

The approach you describe with showing the information in the footer can
only be done in Word using what's called a StyleRef field. But the actual
result you want to see must already be present in the body of the document,
which brings us full circle.

so, yes, the only choice you'd have would be to loop through the table. I
guess the approach I'd try would be to go down the rows, checking the
.Information property for the range until it goes to the next page. I'd
then go back up two rows, SPLIT the table, insert a row, and insert the
total. Then go to the next table (the split one), that should be starting
on the next page, and repeat.

I’m working on a mail merge invoice in Word. All the rows with articles
are in a huge table. When there are more then one pages then there
should be a page total on every page (a running page total). This is
not possible with a sum(above) formula. I’ll need to specify the right
rows on each page. It is possible on a dynamic way?
How can I see which rows are on the same page?

Generally, Word cannot do anything like this. It's a word processor, not
a worksheet program, so there are just certain things it won't do for
you. What you ask would be possible using a macro (VBA) on the merge
result document.


Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Sep 30 2003)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :-)