I am trying to print with the common dialog control, however I have a problem. The printer's hDC property changes each time i check it, so there is never a printer who's hDC matches that of the common dialog. Here is my code:

VB Code:
  1. cdlg.Flags = cdlPDReturnDC
  2. cdlg.ShowPrinter
  3.  
  4.     For Each X In Printers
  5.        If X.hDC = cdlg.hDC Then Set Printer = X
  6.     Next
  7.     Printer.Orientation = cdlg.Orientation
  8.    
  9.     Me.PrintForm
  10.     Printer.EndDoc