Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Open new Word file via Excel
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.d oc") 'Or for a new doc: 'Set WRDDOC = WRDAPP.Documents.Add WRDAPP.Visible = True 'WRDAPP.Quit" Regards, Lupe |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Open new Word file via Excel
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 -- Regards, Halim "Lupe" wrote: 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.d oc") 'Or for a new doc: 'Set WRDDOC = WRDAPP.Documents.Add WRDAPP.Visible = True 'WRDAPP.Quit" Regards, Lupe |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Open new Word file via Excel
Halim,
I have tested this, it opens the new document based on my template but the toolbars for merging are missing. Lupe "Halim" wrote: 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 -- Regards, Halim "Lupe" wrote: 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.d oc") 'Or for a new doc: 'Set WRDDOC = WRDAPP.Documents.Add WRDAPP.Visible = True 'WRDAPP.Quit" Regards, Lupe |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Open new Word file via Excel
add this one to your code
WRDDOC.CommandBars("mail merge").Visible = True -- Regards, Halim "Lupe" wrote: Halim, I have tested this, it opens the new document based on my template but the toolbars for merging are missing. Lupe "Halim" wrote: 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 -- Regards, Halim "Lupe" wrote: 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.d oc") 'Or for a new doc: 'Set WRDDOC = WRDAPP.Documents.Add WRDAPP.Visible = True 'WRDAPP.Quit" Regards, Lupe |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
open word from excel...file does not exist error | Excel Programming | |||
Word and Excel crash when I try to open a folder to get to a file | Excel Discussion (Misc queries) | |||
Using an Excel macro to open a Word File | Excel Programming | |||
Open One Word File from Excel | Excel Programming | |||
Graph Excel Selection, Open Word File, Embed Graph Into Word | Excel Programming |