Registrations are now open. Join us today!
There is still a lot of work to do on the wiki yet! More information about editing can be found here.
Already have an account?

Microsoft KB Archive/107532

From BetaArchive Wiki

Macro to Determine If Active Document Is a Template


The information in this article applies to:

  • Microsoft Word for Windows, version 6.0
  • Microsoft Windows 3.1


To determine if the active document is a template, you can dimension the FileSaveAs dialog to determine the file format. If the document is actually a document template, the format field in the FileSaveAs dialog will return a 1.


FileSaveAs [, .Format = number]
 .Format  0 (zero)  Word document
          1         Document template 

The following macro example macro posts a message if the active document is a template.

Sub Main
Dim dlg As FileSaveAs
GetCurValues dlg
If dlg.Format = 1 Then MsgBox "Active document is a document template"

End Sub 

WARNING: ANY USE BY YOU OF THE CODE PROVIDED IN THIS ARTICLE IS AT YOUR OWN RISK. Microsoft provides this macro code "as is" without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose.

Kbcategory: kbusage kbmacro

Additional query words: 6.0 is template FileSaveAS word6 winword format

Keywords :
Issue type :
Technology :

Last Reviewed: November 4, 2000
© 2001 Microsoft Corporation. All rights reserved. Terms of Use.