ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   What is best method of filling in fields on an MS Word Document? (https://www.excelbanter.com/excel-programming/312724-what-best-method-filling-fields-ms-word-document.html)

alruff[_2_]

What is best method of filling in fields on an MS Word Document?
 

I have a MS Word document in which I have put links to various cells i
an Excel worksheet. I print the MS Word document from Excel throug
VBA automation.

In MS Word I have checked "Update fields on Print", which updates th
fields when I issue wpApp.ActiveDocument.Printout

I am able to open the word document, and print it successfully. Th
problem I am having is that I need to print it 3,000 times as I cycl
through my code.

After about the 20 records MS Word generates an error message:

Word has insufficient memory. You will not be able to undo this actio
once it is completed. Do you want to continue? (Yes,No)

At this point I can only close winword, which leaves it running in th
background. So using task manager on the processes screen I kil
winword.exe, and then Excel crashes with:

Error #4248: This command is not available because no document i
open.

Anyone have an idea for a workaround? Or a better way to manager dat
transfer to Word (Bookmarks?)

Thanks in advance for your reply!!

Ala

--
alruf
-----------------------------------------------------------------------
alruff's Profile: http://www.excelforum.com/member.php...fo&userid=1500
View this thread: http://www.excelforum.com/showthread.php?threadid=26702



All times are GMT +1. The time now is 05:04 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com