Reading Word Template properties

M

MacDermott

I have an application which needs to use Automation to read properties of a
Word template.
I can create an instance of Word and use it to open a document:
set doc = wrd.documents.open("C:\Development\Test.doc")
but if I use
set doc = wrd.documents.open("C:\Development\Test.dot")
I get Test1.doc - a document based on the template, not the template itself.
Of course, then I can't read the Source property of the template.

The template I want isn't a member of the collection wrd.Templates, because
it isn't stored in the default Templates directory.
I could do this:
set dot = doc.attachedtemplate.openasdocument
But it seems like an awfully cumbersome way to do things,
opening both a document and a template just to read a property.

Any ideas?
TIA!
- Turtle
 
C

Cindy M.

Hi MacDermott,
I have an application which needs to use Automation to read properties of a
Word template.
I can create an instance of Word and use it to open a document:
set doc = wrd.documents.open("C:\Development\Test.doc")
but if I use
set doc = wrd.documents.open("C:\Development\Test.dot")
I get Test1.doc - a document based on the template, not the template itself.
And how did you create the Test.dot file? Did you just change .doc to .dot in
the file name?

If this were a "real template", the default file name would be Document# (an
increasing number during a single Word session).

If you have a "real template", created by selecting the Template option in the
New dialog box or by saving explicitly to the file type "Word template", then
File/Open should open the template file.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :)
 

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