This does not solve my problem
First of all, before changing anything, if I display the 'Printer.DeviceName', I got for example :
\\SERVER1\Default Printer Name
Then, after executing my code and setting the printer I want to select as follow :
Set Printer = prt
Then, if I display the 'Printer.DeviceName', I got for example :
\\SERVER2\Selected Printer Name
And this is correct !...
But at this moment, if I type the command :
CMDialog.ShowPrinter
The dialog box is set on \\SERVER1\Default Printer Name instead of \\SERVER2\Selected Printer Name
In fact, I would like to change the default printer of the printer dialog box without calling it.
====================================
I have created a procedure which allows me to determine the correct font to print a file depending on the number of lines per page and a number of characters per lines.
For this, I call the CMDialog box to select the printer, then I use the different API CreateFontIndirect, GetExtentPoint32 and GetTextMetrics to do so.
And it works perfectly !... But I had to use the hDc property of the CMDialog to make it works.
Now, I just want to perform the same code without CMDialog box. Then I used the Printer.hDc but it does not work !....