Field values in word 2002

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

First off: I'm totally a noob!

I want to program this in word 2002:

if the document is a .dot file then DocCode (a field name) is DocCode
if the document is a .doc file then DocCode = filename

This way the document always has the right name when printed. (a .dot
renames it self when opened to document1)

I found out that you can determine if the file is a .dot by
ActiveDocument.Type = wdTypeTemplate but I don’t no where to go from here.
Can any body help me?
 
Thank you for the reply.

With help I made this:

....

If ActiveDocument.Type = wdTypeTemplate Then
ActiveDocument.CustomDocumentProperties("DocCode") = "TemplateType"
End If
If ActiveDocument.Type = wdTypeDocument Then
ActiveDocument.CustomDocumentProperties("DocCode") = "DocumentType"
....

still have to figure out how to read the filename in to change DocCode to
Filename. Any help?
 
Erwin,

I see now that you want to make it in VBNet, however still it is easier to
ask it in the Office developper groups first, with the answer in VBA you can
mostly easy stranslate that to VBNet.

Just my idea.

Cor
 

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

Back
Top