Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I want to open from excel and VBA a Word instance with a document from word
templates. I try this: MyAppID = Shell _ ("C:\Program Files\Microsoft Office\Office11\Winword.EXE C:\OFERTA.dot", 1) AppActivate MyAppID but this open the template himself not a document based on this template. Thank you in advance. Toni |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sub nanann(
Dim WrdApp As Word.Applicatio Dim WrdDoc As Word.Documen Set WrdApp = CreateObject("Word.Application" Set WrdDoc = WrdApp.Documents.Add("YourTemplate" 'other operation WrdDoc.Close SaveChanges:=Fals WrdApp.Quit Set WrdDoc = Nothin Set WrdApp = Nothin End Su |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
"Enescu Gabriel" wrote in message ...
I want to open from excel and VBA a Word instance with a document from word templates. I try this: MyAppID = Shell _ ("C:\Program Files\Microsoft Office\Office11\Winword.EXE C:\OFERTA.dot", 1) AppActivate MyAppID but this open the template himself not a document based on this template. Thank you in advance. Toni Try the following: Sub CreateWordDocFromTemplate() 'Excel VBA to create a new Word document from a Word template. 'Requires reference to Microsoft Word n.n Object Library. Dim wdApp As Word.Application On Error Resume Next Set wdApp = GetObject(, "Word.Application") If Err Then Set wdApp = New Word.Application End If On Error GoTo 0 wdApp.Visible = True wdApp.Activate wdApp.Documents.Add "My Template.dot" Set wdApp = Nothing End Sub the template is located in the default Word templates folder. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How can I convert an Excel document to a Word Document | Setting up and Configuration of Excel | |||
convert excel document to word document (not a picture) | Excel Discussion (Misc queries) | |||
link excel data to word document template | Excel Worksheet Functions | |||
How do I convert a word document into a Excel document | Excel Discussion (Misc queries) | |||
How to change a excel document into a word document? | Excel Discussion (Misc queries) |