View Full Version : Help with Word Automation in Access 2003


kimbalina44
10-17-2006, 08:39 AM
Not sure if anyone can help with this. I am frantically searching and have had no luck!

We have an Access 97 database that I am in the process of converting to Access 2003, testing to ensure everything works okay.

In our database, we have a facility where we are within a person's record, there is a list box of letter templates that we can double-click on a letter, it opens Word and inputs information from the person's record into the letter.

When I try to open it in the converted database, it is having an initial problem with the line to declare the global word application variables:

Public pappWord as Word.Application

The program hangs on this with the error message: Compile error: User-defined type not defined

I'm sure it's probably something really simple, but it's doing my head in!

Is there a different way to do this in Access 2003? Any advice would be appreciated. Someone else built this database and I am trying to work through it. Thanks! :)

deBassMan
10-17-2006, 10:19 AM
You need to reference Microsoft Word Object Library

From the VBE - Tools->References

also - you do not need the Public statement

good luck

kimbalina44
10-17-2006, 11:38 PM
Thank you so much deBassMan!!!! It's working great now. I knew it had to be something simple, but I'm just starting out in VBA and haven't got a complete grasp yet.

This forum is great!! Thanks!! :D