C
Composer
Synopsis: When new doc created by VBA, it has 25 pages. After closing
and opening, it has 23 pages.
(Copied from microsoft.public.word.pagelayout, having had no reply
after 3 days.)
I'm using Word 2000 as an automation server under XP Pro.
MS-Access VBA code creates a new Word doc based on a template.
My 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.
and opening, it has 23 pages.
(Copied from microsoft.public.word.pagelayout, having had no reply
after 3 days.)
I'm using Word 2000 as an automation server under XP Pro.
MS-Access VBA code creates a new Word doc based on a template.
My 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.