How to call open a Word doc with links from within Access 2003

  • Thread starter Thread starter davsch9800
  • Start date Start date
D

davsch9800

In 2000 I use the following code to open both an Excel file and Word template.
The Word template contains a link to the Excel file so data can be merged
into the template.


DoCmd.OutputTo acQuery, "RMA_print_sub", "MicrosoftExcel(*.xls)",
"u:\data\dbfile\RMA\PW\rma_sub_data.xls", False, ""
DoCmd.close acQuery, "RMA_print_sub"

Set wordApp = CreateObject("Word.Application")
wordApp.Visible = True

With wordApp
.Documents.open Filename:="u:\data\dbfile\RMA\PW\rma_data_acc.doc"


This does not work in Access 2003. It will pull up the Word template, but
the links will not be active and the Merge option is grayed out.

At first I thought this was a Word issue, but if I omit Access from the
equation and pull up the Word template after selecting Yes to the following
dialogue box:

Opening this document will run the following SQL command:
SELECT * FROM [RMA_out]
Data from your database will be placed in the document. Do you want to
continue?

So it think the question is: What is the proper syntax in Access to open a
Word template that has links to an Excel file?

Thanks
 
I figured it out.
The problem is in Word not allowing auto VBA command toexecute. I needed to
apply a Registery hack per MS KB 825765.
 
Back
Top