Exporting data to word errors.

G

Guest

I have been trying to work through Cindy Meister's example of using VBA to
send data from Access to word. I wish to push a customer into a form letter
with a list of procedures that they wish to have performed. I have been
slowly editing her code (to be honest, most of what is going on is about my
head, but I have made some progress) to fit my variables, etc.

However, I end up with very strange errors that stop the code execution.
During the AdrInfo() subroutine, the following line gives me errors:
objWord.Selection.Goto What:=Word.wdGoToBookmark, Name:="txtOfferList"

stating that "Word" in the What:=Word.wd... is not defined. I don't
understand! It works fine in her examples, even when coverted to 2000 or
2002 (my original database is in 2000). If I remove the entire What:=...
portion, the code will run and seems to perform properly. Doing this, I am
able to effectively transfer the customer's address info into word.

I'm not sure why that command would give a problem. I did look into the
"resources" in VBA and changed the ActiveX from 2.1 to 2.5 which has altered
some of the errors slightly (letting the "Write Offer" code run further).
Any ideas? Any help would be greatly appreciated.

Brian
 
L

Lance McGonigal

My experience has been to do the forms in Access reports. If it must go
into word then use the analyze with Word feature. I've do thousands of mass
mailing based on client dbs and I've always used access reports.

cheers
 
J

John Nurick

Hi Brian,

Quoting from fellow MVP Doug Steele:

Any time an application works on one machine but not on another, or
suddenly stops working, the first thing to suspect is a References
problem.

This can be caused by differences in either the location or file version
of certain files between the machine where the application was
developed, and where it's being run (or the file missing completely from
the target machine). Such differences are common when new software is
installed.

On the machine(s) where it's not working, open any code module (or open
the Debug Window, using Ctrl-G, provided you haven't selected the "keep
debug window on top" option). Select Tools | References from the menu
bar. Examine all of the selected references.

If any of the selected references have "MISSING:" in front of them,
unselect them, and back out of the dialog. If you really need the
reference(s) you just unselected (you can tell by doing a Compile All
Modules), go back in and reselect them.

If none have "MISSING:", select an additional reference at random, back
out of the dialog, then go back in and unselect the reference you just
added. If that doesn't solve the problem, try to unselect as many of the
selected references as you can (Access may not let you unselect them
all), back out of the dialog, then go back in and reselect the
references you just unselected. (NOTE: write down what the references
are before you delete them, because they'll be in a different order when
you go back in)

For far more than you could ever want to know about this problem, check
out
http://members.rogers.com/douglas.j.steele/AccessReferenceErrors.html
 

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