WD: FilePrint Parameter Differences Between Word 6.x and 95

ID: Q184973

The information in this article applies to:

SUMMARY

The parameters of the WordBasic FilePrint command are different between Microsoft Word 6.x for Windows and Word for Windows 95, version 7.x. This may cause problems if you are automating Word from another program that doesn't support the use of named parameters, for example, Microsoft Visual Basic 3.0.

MORE INFORMATION

Microsoft provides programming examples for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability and/or fitness for a particular purpose. This article assumes that you are familiar with the programming language being demonstrated and the tools used to create and debug procedures. Microsoft support professionals can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific needs. If you have limited programming experience, you may want to contact the Microsoft fee-based consulting line at (800) 936-5200. For more information about the support options available from Microsoft, please see the following page on the World Wide Web:

   http://www.microsoft.com/support/supportnet/refguide/

Word 6.x

The following is the FilePrint parameter order for Word 6.x for Windows:

   FilePrint Background:=, AppendPrFile:=, Range:=, PrToFileName:=, \ 
   From:=, To:=, Type:=, NumCopies:=, Pages:=, Order:=, PrintToFile:=, \ 
   Collate:=, FileName:=

Word 7.x

The following is the FilePrint parameter order for Word 7.x:

   FilePrint Background:=, Printer:=, OutputPrinter:=, AppendPrFile:=, \ 
   Range:=, PrToFileName:=, From:=, To:=, Type:=, NumCopies:=, Pages:=, \ 
   Order:=, PrintToFile:=, Collate:=, FileName:=

Macro to Test the Version

You can use the following sample Visual Basic macro in Microsoft Excel 95 for Windows to test the version of Word.

NOTE: In the following macro, Word will not be visible.

NOTE: This macro will not funtion correctly with versions of Word later than Word 7.x.

   Sub WhichVersion()

      Dim wObj As Object

      ' If Word is not intalled, an error will occur.
      On Error GoTo NoWord

      ' If Word is running, get instance or
      ' if Word is not running, run Word and get instance.
      Set wObj = GetObject("","Word.Basic")

      ' Test the version of Word.
      If Val(wObj.AppInfo$(2)) = 6 then
         ' <Use the Word 6.x FilePrint parameters>
      ElseIf  Val(wObj.AppInfo$(2)) = 7 then
         ' <Use the Word 95 FilePrint parameters>
      End If

   NoWord:

      If Err <> 0 Then
         MsgBox "Word not found."
      End If

      ' Quit Word and clear object variable.
      Set wObj = Nothing

   End Sub

REFERENCES

For additional information, please see the following articles in the Microsoft Knowledge Base:

   ARTICLE-ID: Q105534
   TITLE     : WD: OLE: Visual Basic 3.0 Does Not Support Named Arguments

   ARTICLE-ID: Q112733
   TITLE     : FILE: Help File for VB OLE Automation w/ Word for Windows

Additional query words: ole print routine arguments
Keywords          : kbprg kbdta kbdtacode word6 word7 word95 
Version           : WINDOWS:6.0,6.0a,6.0c,7.0,7.0a
Platform          : WINDOWS
Issue type        : kbinfo

Last Reviewed: April 9, 1999