I need to be able to select a destination print device and interrogate that device prior to printing (for unprintable areas etc), using the VPE ActiveX object in Visual FoxPro.
The basic way I was going to do this is:
- Code: Select all
WITH VPEDoc
IF .SetupPrinter("", PRINT_ALWAYS) = 0
* user selected OK
.SetPrinter(.DevPrinterOffsetX, .DevPrinterOffsetY)
.PrintDoc(FALSE)
ENDIF
ENDWITH
The problem is that, if I use "", SetupPrinter() returns 3, which indicates "I/O problems during write of setup file" as opposed to 0 for OK.
I don't need to write a setup file as I merely need to get the user to selected the device before I run the print job, which I can't do with PrintDoc(TRUE).
Can I safely ignore this error code or is there a better way to go about this ?
regards,
Matt.