Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Common Dialog - PrinterDlg

Status
Not open for further replies.

Chad123

Programmer
Apr 11, 2003
52
CA
Hey,

I am using the PrinterDlg for the common dialog, and I am getting this error when I run the PrinterDlg.ShowPrinter objWPForm.hWnd

Error Number = -2147467259
Automation Error
Unspecified Error

Here is my code up to where it errors out:

Dim objPrinter As PrinterDlg
On Error GoTo PrintErr
Set txCur = objWPForm.txTextcontrol1
Set objPrinter = New PrinterDlg
objPrinter.CancelError = True
objPrinter.Flags = VBPrinterConstants.cdlPDNoSelection _
Or VBPrinterConstants.cdlPDNoPageNums _
Or VBPrinterConstants.cdlPDReturnDC _
Or VBPrinterConstants.cdlPDHidePrintToFile
objPrinter.ShowPrinter objWPForm.hwnd


Any Ideas why I am getting this error and/or how to fix it?

Thanks,
Chad
 
Nevermind....

I figured out the hard way that you actually have to specify the initial, current printer settings in the Printerdlg before you can show it.

Case Closed!

Thanks Anywho
Chad
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top