ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Open Word Template (https://www.excelbanter.com/excel-programming/324641-open-word-template.html)

TAM

Open Word Template
 
Within Excel I am trying to open a new document from a Word template file
but the template file itself keeps opening. Can you please advise how to
open a document from the template - my code is as follows...

Dim wdApp As Word.Application
Set wdApp = New Word.Application
With wdApp
.Documents.Open Filename:="C:\My Documents\Work\Manual Project\Templates\01
Front Cover.dot"

I have tried this code with the .doc extension but that only results in an
error

Thanks

TAM



Tom Ogilvy

Open Word Template
 
Why not go to word and turn on the macro recorder, then execute the action
you want and turn it off. Look at the recorded code to see how Word sets up
the command.

--
Regards,
Tom Ogilvy

"TAM" wrote in message
.uk...
Within Excel I am trying to open a new document from a Word template file
but the template file itself keeps opening. Can you please advise how to
open a document from the template - my code is as follows...

Dim wdApp As Word.Application
Set wdApp = New Word.Application
With wdApp
.Documents.Open Filename:="C:\My Documents\Work\Manual

Project\Templates\01
Front Cover.dot"

I have tried this code with the .doc extension but that only results in an
error

Thanks

TAM






All times are GMT +1. The time now is 09:09 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com