Opening word template as a document

J

Job Lot

How can I programmatically open a template as a document? When I use
Application.Documents.Open method to open and pass FileName parameter as path
to .dot file it opens the it in .dot format and not .doc

Thanks

object source = @"c:\temp\mytemplate.dot";
this.Application.Documents.Open(ref source, ref missing, ref missing, ref
missing,
ref missing, ref missing, ref missing, ref
missing,
ref missing, ref missing, ref missing, ref
missing,
ref missing, ref missing, ref missing, ref
missing);
 
J

Jay Freedman

Although it's possible to open a template "as a document" so that the
template itself can be edited, I don't think that's really what you
want to do. If you want a document _based on_ the template, so that
the document is editable but the template remains unchanged, then use
the Application.Documents.Add method instead, passing the template's
name as the first argument and ref missing for the other three
arguments.
 
J

Job Lot

Thanks

Jay Freedman said:
Although it's possible to open a template "as a document" so that the
template itself can be edited, I don't think that's really what you
want to do. If you want a document _based on_ the template, so that
the document is editable but the template remains unchanged, then use
the Application.Documents.Add method instead, passing the template's
name as the first argument and ref missing for the other three
arguments.



--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit.
 

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