>>I have a routine that prints a Word document (from VFP application, of course). But it prints document to a default printer. The segment of the code that prints the document is as following:
>>
>>
>> oDocument = oWord.Documents.Open( cFile2Attach )
>> if type( "oDocument" ) = "O" and !isnull( oDocument )
>> oDocument.PrintOut(.F.)
>> oDocument.Close()
>> endif
>>
>>
>>Where in the above code I can specify where (printer name) to send this document? And what is the syntax?
>>
>>Thank you in advance for any help
>
>Try:
>
>#DEFINE wdDialogFilePrintSetup 97
>lcPrinter = GETPRINTER()
>
>oWord = CreateObject("Word.Application")
>
>WITH oWord.Dialogs(wdDialogFilePrintSetup)
> .Printer = lcPrinter
> .DoNotSetAsSysDefault = .t.
> .execute()
>ENDWITH
>
>Can't test it right now
Borislav,
Thank you very much. I can't test it right now either. But will test it tomorrow.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham