Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Help with formatting a table in Word97
Message
From
20/10/2000 04:32:53
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00430336
Message ID:
00431988
Views:
13
>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
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform