|
I was trying to create a task printer. but it was giving me error to add a printer.
ePrintV51.AddPrinter PUBLICS_IMAGING.pIMAGE_PRINT_DRIVER, PRINTER_TASK
'PUBLICS_IMAGING.pIMAGE_PRINT_DRIVER = "Leadtools Eprint 5"
----------------------------------------------------------------------------------
Currently I am having this code
When ever I am debugging the code Image is getting generated and code is also working fine. But this not the case when I am executing directly and one SAVE AS dialog box is opening up which I have attached as Image.
Dim ePrintV51 As EPrint Dim PrinterSaveOptions1 As EpnPrinterSaveOptions Dim MultiSaveOptions1 As EpnMultiSaveOptions Dim ExtraDcOptions1 As EpnExtraDcOptions Dim HDC1 As Long Dim nRet As Integer Dim strDestFileName As String
PUBLICS_SET_PRINTER.ChangeDefaultPrinter PUBLICS_IMAGING.pIMAGE_PRINT_DRIVER ''PUBLICS_IMAGING.pIMAGE_PRINT_DRIVER is a "Leadtools Eprint 5" DoEvents
Set ePrintV51 = New EPrint Set PrinterSaveOptions1 = New EpnPrinterSaveOptions Set MultiSaveOptions1 = New EpnMultiSaveOptions Set ExtraDcOptions1 = New EpnExtraDcOptions If ePrintV51.IsSupportLocked(LPEPCLib.SupportLockConstants.SUPPORT_EVAL) Then ePrintV51.UnlockSupport LPEPCLib.SupportLockConstants.SUPPORT_EVAL, "" End If
strDestFileName = mFILE_TEMP_PATH & CStr(mlngLeadNmbr) & "-" & mFILE_TEMP_NAME & ".JPG" nRet = ePrintV51.GetPrinterSaveOptions(PUBLICS_IMAGING.pIMAGE_PRINT_DRIVER, MultiSaveOptions1) MultiSaveOptions1.UseSave = True MultiSaveOptions1.SaveElementsCount = 1 MultiSaveOptions1.PrinterSaveOptions(0).SaveOptions.FileName = strDestFileName MultiSaveOptions1.PrinterSaveOptions(0).SaveOptions.Format = FILE_JPEG MultiSaveOptions1.PrinterSaveOptions(0).SaveOptions.DocumentType = FT_SAVE_TYPE_RASTER MultiSaveOptions1.PrinterSaveOptions(0).SaveOptions.RasterOptions.BITSPERPIXEL = 24 MultiSaveOptions1.PrinterSaveOptions(0).SaveOptions.RasterOptions.QFactor = 100 MultiSaveOptions1.PrinterSaveOptions(0).SaveOptions.RasterOptions.StampBits = 24 MultiSaveOptions1.PrinterSaveOptions(0).SaveOptions.RasterOptions.StampWidth = 128 MultiSaveOptions1.PrinterSaveOptions(0).SaveOptions.RasterOptions.StampHeight = 128 MultiSaveOptions1.PrinterSaveOptions(0).SaveOptions.RasterOptions.MultiPageFile = False MultiSaveOptions1.PrinterSaveOptions(0).Flags = 0
Set PrinterSaveOptions1 = MultiSaveOptions1.PrinterSaveOptions(0) nRet = ePrintV51.SetPrinterSaveOptions(PUBLICS_IMAGING.pIMAGE_PRINT_DRIVER, MultiSaveOptions1)
HDC1 = ePrintV51.CreateSaveDC(PUBLICS_IMAGING.pIMAGE_PRINT_DRIVER, Nothing, PrinterSaveOptions1, ExtraDcOptions1)
If (HDC1 <> 0) Then ePrintV51.StartDocumentConversion PUBLICS_IMAGING.pIMAGE_PRINT_DRIVER, 0 wb.ExecWB OLECMDID_PRINT, OLECMDEXECOPT_DONTPROMPTUSER, 0, 0 'Here I am getting the SAVE as dialog box in run mode.. 'strange is that in dubug mode it is not coming and image is getting saved as per code. ePrintV51.EndDocumentConversion PUBLICS_IMAGING.pIMAGE_PRINT_DRIVER, 0 End If
Please tell me why this save as dialog box is coming while same code is working for other objects like word/Excel. But with web browser its coming in execution mode.
|