open word doc

  • Thread starter Thread starter swain.s
  • Start date Start date
Attach this macro to the button
Sub test()
Set wrdApp = CreateObject("Word.Application")
'Uncomment the next line to open a specific document and change the path and
name
'Set wrdDoc = wrdApp.Documents.Open("C:\Doc1.doc")
wrdApp.Visible = True
End Sub
 
Sorry I forgot to add that you must pick Microsoft Word 11.0 from
Tools>References in the VB editor to execute Word commands.

See VB Help topic "Controlling One Microsoft Office Application from Another"
for more information.

Also if you have set Option Explicit then declare
Dim wrdApp As Word.Application
 
hello Sheelo

ican now open a word doc but the page is empty the doc that i am trying to
open is not opening
 
Did you remove the comment indicator (') from the following line
'Set wrdDoc = wrdApp.Documents.Open("C:\down.doc")

You also need to change the path and name to your document
 

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

Back
Top