PC Review


Reply
Thread Tools Rate Thread

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

 
 
davsch9800
Guest
Posts: n/a
 
      21st Mar 2010
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

 
Reply With Quote
 
 
 
 
davsch9800
Guest
Posts: n/a
 
      22nd Mar 2010
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.



"davsch9800" wrote:

> 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
>

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
word 2003 says i do not have access priviliges to open my files lonewolfauctions Microsoft Access Security 0 14th May 2009 02:36 AM
Open varying word files in access 2003 Jeff Microsoft Access Macros 0 9th Oct 2006 07:21 AM
Using Call Shell to open Excel Workbook within Access 2003, SP2 Ve =?Utf-8?B?TGFycnkgU3RvdWRlbWlyZQ==?= Microsoft Access VBA Modules 1 24th Aug 2006 07:04 AM
Open links in Word 2003 =?Utf-8?B?V2FuZGFTRw==?= Microsoft Word Document Management 0 1st Mar 2006 02:17 PM
how do I open a access file .mdb on Word 2003? =?Utf-8?B?Zmx5Z2Fs?= Microsoft Word New Users 2 21st Dec 2004 04:52 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:06 PM.