Is it possible to open a Word97 Doc from Excel97??

GaryB

Active Member
Joined
Feb 25, 2002
Messages
459
I am trying to write a macro that will extract a bunch of information from a spreadsheet and use it to produce letters in Word97 using mailmerge. The data extraction bit works fine and generates a data file for me, and I can switch to Word using "Application.ActivateMicrosoftApp xlMicrosoftWord", but how do I get my Word doc to open automatically?
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
Gary, I believe this is already automated for you using Mail Merge. See the steps at my site by clicking on the Word Stuff link. Let me know if you have any problems with that. Basically, you don't need to create a separate file to do a mail merge, which has its own query options.
 
Upvote 0
I had the same problem as you. This code should work.

Sub MtoOpenWord()

Dim wdApp As Object
Set wdApp = CreateObject("Word.Application")
wdApp.Visible = True
wdApp.documents.Open "C:FILENAME.doc"
End Sub

Where FILENAME type the name of your file.
 
Upvote 0

Forum statistics

Threads
1,214,786
Messages
6,121,553
Members
449,038
Latest member
Guest1337

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top