Logo 
Search:

MS Office Forum

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds

opening word document in excel

  Asked By: Anpu    Date: Feb 25    Category: MS Office    Views: 934
  

I have a procedure that gets information into excel and saves a file,
and then it is supposed to open a word mailmerge document and get the
document to use the new file as a data source.

I can't seem to get the syntax right on opening the word doc.
Any help would be appreciated

Dim L300_word As Object
Set L300_word = GetObject _
("D:\documents and settings\chmzw\My Documents\claims\ _
L300\L300.dot", "Word.application")

Share: 

 

1 Answer Found

 
Answer #1    Answered By: Albert Ellis     Answered On: Feb 25

First, you'll need a reference to the word  object model. Then I use this
code to add a document  based on a particular template:

Private Sub CommandButton1_Click()
Set mobjWordApp = New Word.Application
With mobjWordApp
.Visible = True
.WindowState = wdWindowStateMaximize
.Documents.Add Template:="C:\Case prep\standardackv4.dot"
End With
End Sub

You'll need .Documents.Open to use an existing document, I think.

 
Didn't find what you were looking for? Find more on opening word document in excel Or get search suggestion and latest updates.




Tagged: