Vba - opening doc from Excel Vba

A

ajliaks

Hi all,

Does anybody knows how to open Template.dot from excel Vba?

I asume it's something like:

ChangeFileOpenDirectory Route

Documents.Open Filename:="Template.dot"

I think the problem is with References. I tried activating "Microsof
Word 11 Object Library" but still doesn't works.

Thanks,
Aldo
 
H

Helen Trim

As well as adding in the reference to the Word object
library, you need to create an instance of Word and make
it visible. Then you can use this Word to open the
template.

Use code similar to this:

' Declare a variable and set it to an instance of Word
Dim Word As New Word.Application

' Make the application visible
Word.Visible = True
' Open the document
Word.Documents.Open "C:\Templates\template.dot"

I've called my variable Word, but it can be anything you
like.

HTH
Helen
 
Top