Word PrintOut crashes Access 2002

E

Edward Paine

I have a database (AC2002) distributed to several computers as an mde file,
all running Access 2002 Runtime with the latest patches. If they are running
Word 9.0 (2000) then the following command (attempting to print a Word
document via Automation) crashes Access:

MyWordObj.ActiveDocument.PrintOut Background:=True, Pages:="1"

It works fine on machines running Word 10.0 (2002) and also has run in the
past without problem when the mde was Access 2000 version.

Any clues anyone?

Ed
 
A

Albert D. Kallal

If the pc you develop on has different references you set in the references
section, then you must ensure that your users are running the same version.

Broken references questions in this newsgroup is probably the MOST common
question.

Unless you are using late binding, then you are asking for trouble.

I also have some notes on how to make a rock solid bullet proof word merge.
You can download a working example, and read my notes on how I archived such
a reliable word merge system.

Check out my word merge..and *read* the notes on my web page..
http://www.attcanada.net/~kallal.msn/msaccess/msaccess.html

Regardless, you need to remove all references to word in your
tools->references section, and then use late binding.
 
G

Guest

Edward Paine said:
Thank you for your response. All the references are the same as the same mde
file is distributed to all the PC's on the network. I like to keep the
references as otherwise you don't get any syntax help.

Setting the declaration to:
Dim myWordObject as Object, rather than as Word.Application solved by
problem. I presume this is what you meant by late binding.

Best wishes

Ed
 
A

Albert D. Kallal

Edward Paine said:
Thank you for your response. All the references are the same as the same mde
file is distributed to all the PC's on the network. I like to keep the
references as otherwise you don't get any syntax help.

You are correct. What I do is develop with the references set, then when the
code is done, I remove the references. And change all code to use the object
def. You loose inteli-sense. However, any other approach to development is
simply asking for major trouble.
Setting the declaration to:
Dim myWordObject as Object, rather than as Word.Application solved by
problem. I presume this is what you meant by late binding.

yes, that correct. And, yes...you do loose inteli-sense. In fact, you also
loose the ability catch errors at compile time..so extra caution needs to be
taken here.
 

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