Problem with the Print Dialog
Hello!
I'm using the Print Dialog Class in my VB.Net code and having problems selecting the correct network printer. I'm able to set up and change all printer parameter from my code and to start the print out using a printer settigs class.
Although the printer dialog keeps telling me that the document is being sent to the priter I have selected, it actually sents it to the printer selected as standard printer in Windows. Does anyone know what I'm doing wrong, or is there maybe a registry key I'm not aware of?
Here the code I wrote to use the printer dialog:
With pdgPrint'basic settings for print dialog
'-
.AllowPrintToFile =True
.AllowSomePages =True
'create and populate the printer settings objects
'--
.PrinterSettings =New PrinterSettings
With .PrinterSettings
.PrintRange = PrintRange.SomePages
.FromPage = 1
.ToPage = maxPAGE
.MinimumPage = 1
.MaximumPage = maxPAGE
EndWith 'show the print dialog
'--
If .ShowDialog <> DialogResult.OKThen
.Dispose()
ExitSub
EndIf If .PrinterSettings.PrintRange = PrintRange.SomePagesThen
'print the selected range of pages
'--
prnPages(.PrinterSettings.FromPage, .PrinterSettings.ToPage)
ElseIf .PrinterSettings.PrintRange = PrintRange.AllPagesThen
'print all pages of the specified LOC
'--
Dim lastPageAsInteger
If (pgNR = 255)Then lastPage = 1Else lastPage = pgCNT
prnPages(1, lastPage)
EndIf
EndWith
Thanks, Horst

