Opening a Word Doc

L

Little Penny

I have a MS Word document that is merged with and excel spread sheet.
When I open the word doc (double click) I get the following message:

Opening this document will run the following SQL command

SELECT*FROM 'Data$'

Data from your database will be placed in the document Do you want to
continue y or n

Which is what I want.


But if I use a macro from Excel to open the Word doc


oWord.Documents.Open "C:\test\DataDoc.doc"


It does not run the SQL command.


Am I doing something wrong?



Thanks



Little Penny
 
G

Gary''s Student

See if:

ActiveWorkbook.FollowHyperlink Address:="C:\test\DataDoc.doc"
or
x = Shell("cmd.exe /c C:\test\DataDoc.doc", 1)

behave any better.
 
L

Little Penny

On Sat, 6 Sep 2008 06:53:01 -0700, Gary''s Student


Worked great....


Thanks
 

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