Microsoft KB Archive/90751

{|
 * width="100%"|

WD: Modifying FileSaveAs to Use Different Default Format

 * }

Q90751

-

The information in this article applies to:


 * Microsoft Word for Windows, versions 2.0, 2.0a, 2.0a-CD, 2.0b, 2.0c, 6.0, 6.0a, 6.0c
 * Microsoft Word for Windows, versions 7.0, 7.0a
 * Microsoft Word for the Macintosh, versions 6.0, 6.0.1, 6.0.1a

-

SUMMARY
In Word 7.x and earlier, you can change the default file format selected in the Save As dialog box by modifying the FileSaveAs macro. The &quot;More Information&quot; section of this article discusses how to do this for each version of Word.

NOTE: Beginning with Word 97 for Windows or Word 98 Macintosh Edition you can set the file format that Word uses by default each time you save a document. To do this, click Options (Preferences in Word 98 Macintosh Edition) on the Tools menu, click the Save tab, and select the file format you want from the Save Word Files As drop-down list.

MORE INFORMATION
When you click Save As on the File menu, Normal file format is selected by default. To change this selection, modify the global FileSaveAs macro by setting the Format argument to a specific number that corresponds to the desired default file format as follows.

Word 7.x
Word version 7.x includes a function called ConverterLookup that returns a number corresponding to a specified converter. The number returned by ConverterLookup can be used with FileSaveAs to specify a different format.

  Sub MAIN Dim dlg As FileSaveAs GetCurValues dlg x = ConverterLookup(&quot;Word 2.x for Windows&quot;) dlg.Format = x     n = Dialog(dlg) If n = -1 then FileSaveAs dlg End Sub NOTE: &quot;Word 2.x for Windows&quot; is the name of the file format as it appears in the Save File As Type box in the Save As dialog box (File menu).

NOTE: The ConverterLookup method described above, can also be used with Word 6.0 for the Macintosh. For example, the following macro instructions save the current document as Test in the stationery file format.

  x = ConverterLookup(&quot;Stationery&quot;) FileSaveAs .Name = &quot;Test&quot;, .Format = x

Word 6.x
Word version 6.x for Windows includes a function called ConverterLookup that returns a number corresponding to a specified converter. The number returned by ConverterLookup can be used with FileSaveAs to specify a different format.

  Sub MAIN Dim dlg As FileSaveAs GetCurValues dlg x = ConverterLookup(&quot;Word for Windows 2.0&quot;) dlg.Format = x     n = Dialog(dlg) If n = -1 then FileSaveAs dlg End Sub NOTE: &quot;Word for Windows 2.x&quot; is the name of the file format as it appears in the Save File As Type box in the Save As dialog box (File menu).

NOTE: The ConverterLookup method described above, can also be used with Macintosh Word 6.x. For example, the following macro instructions save the current document as Test in the stationery file format.

  x = ConverterLookup(&quot;Stationery&quot;) FileSaveAs .Name = &quot;Test&quot;, .Format = x

Word 2.x
  Sub MAIN Dim dlg As FileSaveAs GetCurValues dlg dlg.Format = N '(number corresponding to the Format argument) n = Dialog(dlg) If n = - 1 Then FileSaveAs dlg End Sub To indicate a file format other than the six internal formats, you can count the first converter listed under the [MSWord TextConverters] section as either 7 or 100 and then count down the list. For example, based on the following WIN.INI settings, the WordPerfect 5.1 converter can be counted as format 103 or 10:

  [MSWord Text Converters] DOS Text with Layout-DOS Text with Layout, C:\WINWORD\TXTWLYT.CNV, asc Text with Layout-Text with Layout, C:\WINWORD\TXTWLYT.CNV, ans WrdPrfctDOS50-WordPerfect 5.0, C:\WINWORD\WPFT5.CNV, doc WrdPrfctDOS-WordPerfect 5.1, C:\WINWORD\WPFT5.CNV, doc MSWordWin-Word for Windows 1, C:\WINWORD\WORDWIN1.CNV, doc To save a document to the Word for Windows 1.x file format by default, set the .Format parameter to 104 or 11 (based on the above WIN.INI settings) as follows:

  Sub MAIN Dim dlg As FileSaveAs GetCurValues dlg dlg.Format = N '(number corresponding to the Format argument) n = Dialog(dlg) If n = - 1 Then FileSaveAs dlg End Sub The following six formats are internal to Word for Windows and can be set using the .Format parameter:

  0  Normal (Word format).

1 Document Template.

2 Text Only (extended characters saved in ANSI character set).

3 Text+Breaks (plain text with line breaks; extended characters saved      in ANSI character set).

4 Text Only (PC-8) (extended characters saved in IBM PC character      set).

5 Text+Breaks (PC-8) (text with line breaks; extended characters      saved in IBM PC character set).

6 Rich Text Format (RTF).