Open new Word file via Excel

L

Lupe

Hi
I've created a Word template with many mergefields and includetexts. The
data source is in Excel. I want the users to be able to open automatically
via a macrobutton a new Word file based on my template when they finish enter
their source data and merge the information.
I have already managed to open an existing file via a macrobutton. I got the
following code from a post of Sept 2006 by moon. How can I elaborate on this
code to get a new file to open based on another template than normal.dot?

"Dim WRDAPP, WRDDOC
Set WRDAPP = CreateObject("Word.Application")
Set WRDDOC = WRDAPP.Documents.Open("C:\Security\Procesverbaal.doc")
'Or for a new doc:
'Set WRDDOC = WRDAPP.Documents.Add

WRDAPP.Visible = True
'WRDAPP.Quit"
Regards, Lupe
 
H

Halim

use this one maybe help
Dim WRDAPP, WRDDOC
Set WRDAPP = CreateObject("Word.Application")
'Or for a new doc:
Set WRDDOC = WRDAPP.Documents.Add _
Template:= "C:\Template\yourtmplate.doc"

WRDAPP.Visible = True
 
L

Lupe

Halim,
I have tested this, it opens the new document based on my template but the
toolbars for merging are missing.
Lupe
 

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