Pagination is changed by Close/Open

C

Composer

Using Word 2000 as an automation server under XP Pro.

MS-Access VBA code creates a new Word doc based on a template.

Client is extremely picky about the final look of the document, and
wants it formatted by the software at the push of a button -- because
every time a detail in the database is fine-tuned, they want a new Word
doc that doesn't need manual adjusting.

Problem:

VBA code does its final clean-up of the new Word doc based partly on
where page breaks are found. Eg. if a very long table cell has caused
lots of white space to be left on the preceding page, the cell will be
split. However, the pagination that VBA works with is not the same as
the final document's. Have observed an example that is 25 pages long
while VBA is running, which after saving, closing, and opening again
turns out to have only 23 pages. As a result the fine-tuning done by
VBA is now wrong.

Have tried various combinations of doc.Repaginate, doc.PrintPreview,
etc. The final pagination does not seem to happen until the document
has been closed and opened.

I suppose I could close and reopen the doc within the VBA code, but
this changes the logic flow. Is it avoidable?

Thanks.
 

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