DECLARE OpenPrinter IN Winspool.drv; STRING @pPrinterName,; INTEGER @phPrinter, STRING @pDefault * I'd pass 0 to indicate a null pointer to pDefault, but that's just me DECLARE INTEGER DocumentProperties IN Winspool.drv; INTEGER hWnd, INTEGER hPrinter,; STRING @pDeviceName, STRING @pDevModeOutput,; STRING @pDevModeInput, INTEGER fModeI think that may be the source of your problem.