>Tamar,
>
>I am trying to get Word97 to print using VFP and using the following code:
>
> nCopies = 1
> cPages = ""
> nRange = wdPrintAllDocument
> nItem = wdPrintDocumentContent
> nPageType = wdPrintAllPages
> lCollate = .T.
> lBackground = .T.
> lPrintToFile = .T.
> lAppend = .F.
>
> oWord.ActivePrinter = "Mercury"
>
> cDocName = oWord.ActiveDocument.Name
>
> cPRNFileName = cPDFInPath + LEFT(cDocName,AT(".",cDocName) - 1) + ".PRN"
>
> oWord.Application.PrintOut(cDocName,;
> wdPrintAllDocument,;
> wdPrintDocumentContent,;
> nCopies,;
> cPages,;
> nPageType,;
> lCollate,;
> lBackground,;
> lPrintToFile,;
> cPRNFileName,;
> lAppend)
>
>*!* Application.PrintOut FileName:="", Range:=wdPrintAllDocument, Item:= _
>*!* wdPrintDocumentContent, Copies:=1, Pages:="", PageType:=wdPrintAllPages,
>*!* Collate:=True, Background:=True, PrintToFile:=True,OuputFileName:="", _
>*!* Append:=False
>
>*******************************
>
>It keeps giving me a TYPE MISMATCH ERROR. What am I doing wrong?
>
>Dave :-)
David,
PrintOut syntax from help :
expression.PrintOut(Background, Append, Range, OutputFileName, From, To, Item, Copies, Pages, PageType, PrintToFile, Collate, FileName, ActivePrinterMacGX, ManualDuplexPrint, PrintZoomColumn, PrintZoomRow, PrintZoomPaperWidth, PrintZoomPaperHeight)
IOW you have the parameters in wrong places. You recorded a macro but VB could use named arguments not VFP. Parameters should be in exact places :
oWord.ActiveDocument.Printout(.T.,,,cOutputFileName,,,,,,,.T.)
Cetin