<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic CommonDialog - ShowPrinter in VBA Forum</title>
    <link>https://forums.autodesk.com/t5/vba-forum/commondialog-showprinter/m-p/1491209#M38872</link>
    <description>Does enyone know why "Page Setup" dialog does not return the right PaperSize&lt;BR /&gt;
and the Orientation that user changes. Here is the code:&lt;BR /&gt;
&lt;BR /&gt;
Private Sub Command1_Click()&lt;BR /&gt;
&lt;BR /&gt;
    On Error Resume Next&lt;BR /&gt;
&lt;BR /&gt;
    With Printer&lt;BR /&gt;
        MsgBox "DeviceName:" &amp;amp; vbTab &amp;amp; .DeviceName &amp;amp; vbLf &amp;amp; _&lt;BR /&gt;
                      "PaperSize:" &amp;amp; vbTab &amp;amp; .PaperSize &amp;amp; vbLf &amp;amp; _&lt;BR /&gt;
                      "Orientation:" &amp;amp; vbTab &amp;amp; .Orientation&lt;BR /&gt;
        End With&lt;BR /&gt;
&lt;BR /&gt;
    With CommonDialog1&lt;BR /&gt;
        .CancelError = True&lt;BR /&gt;
        .Flags = cdlPDNoSelection + _&lt;BR /&gt;
                     cdlPDPageNums + _&lt;BR /&gt;
                     cdlPDDisablePrintToFile + _&lt;BR /&gt;
                     cdlPDPrintSetup ' + _&lt;BR /&gt;
                     cdlPDNoWarning&lt;BR /&gt;
        .ShowPrinter&lt;BR /&gt;
&lt;BR /&gt;
        If Err Then&lt;BR /&gt;
            If Err.Number = 32755 Then&lt;BR /&gt;
                Exit Sub&lt;BR /&gt;
            Else&lt;BR /&gt;
                MsgBox Err.Number &amp;amp; " : " &amp;amp; Err.Description&lt;BR /&gt;
            End If&lt;BR /&gt;
        End If&lt;BR /&gt;
    End With&lt;BR /&gt;
&lt;BR /&gt;
    With Printer&lt;BR /&gt;
        MsgBox "DeviceName:" &amp;amp; vbTab &amp;amp; .DeviceName &amp;amp; vbLf &amp;amp; _&lt;BR /&gt;
                      "PaperSize:" &amp;amp; vbTab &amp;amp; .PaperSize &amp;amp; vbLf &amp;amp; _&lt;BR /&gt;
                      "Orientation:" &amp;amp; vbTab &amp;amp; .Orientation&lt;BR /&gt;
    End With&lt;BR /&gt;
&lt;BR /&gt;
End Sub</description>
    <pubDate>Fri, 18 Nov 2005 23:38:09 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2005-11-18T23:38:09Z</dc:date>
    <item>
      <title>CommonDialog - ShowPrinter</title>
      <link>https://forums.autodesk.com/t5/vba-forum/commondialog-showprinter/m-p/1491209#M38872</link>
      <description>Does enyone know why "Page Setup" dialog does not return the right PaperSize&lt;BR /&gt;
and the Orientation that user changes. Here is the code:&lt;BR /&gt;
&lt;BR /&gt;
Private Sub Command1_Click()&lt;BR /&gt;
&lt;BR /&gt;
    On Error Resume Next&lt;BR /&gt;
&lt;BR /&gt;
    With Printer&lt;BR /&gt;
        MsgBox "DeviceName:" &amp;amp; vbTab &amp;amp; .DeviceName &amp;amp; vbLf &amp;amp; _&lt;BR /&gt;
                      "PaperSize:" &amp;amp; vbTab &amp;amp; .PaperSize &amp;amp; vbLf &amp;amp; _&lt;BR /&gt;
                      "Orientation:" &amp;amp; vbTab &amp;amp; .Orientation&lt;BR /&gt;
        End With&lt;BR /&gt;
&lt;BR /&gt;
    With CommonDialog1&lt;BR /&gt;
        .CancelError = True&lt;BR /&gt;
        .Flags = cdlPDNoSelection + _&lt;BR /&gt;
                     cdlPDPageNums + _&lt;BR /&gt;
                     cdlPDDisablePrintToFile + _&lt;BR /&gt;
                     cdlPDPrintSetup ' + _&lt;BR /&gt;
                     cdlPDNoWarning&lt;BR /&gt;
        .ShowPrinter&lt;BR /&gt;
&lt;BR /&gt;
        If Err Then&lt;BR /&gt;
            If Err.Number = 32755 Then&lt;BR /&gt;
                Exit Sub&lt;BR /&gt;
            Else&lt;BR /&gt;
                MsgBox Err.Number &amp;amp; " : " &amp;amp; Err.Description&lt;BR /&gt;
            End If&lt;BR /&gt;
        End If&lt;BR /&gt;
    End With&lt;BR /&gt;
&lt;BR /&gt;
    With Printer&lt;BR /&gt;
        MsgBox "DeviceName:" &amp;amp; vbTab &amp;amp; .DeviceName &amp;amp; vbLf &amp;amp; _&lt;BR /&gt;
                      "PaperSize:" &amp;amp; vbTab &amp;amp; .PaperSize &amp;amp; vbLf &amp;amp; _&lt;BR /&gt;
                      "Orientation:" &amp;amp; vbTab &amp;amp; .Orientation&lt;BR /&gt;
    End With&lt;BR /&gt;
&lt;BR /&gt;
End Sub</description>
      <pubDate>Fri, 18 Nov 2005 23:38:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/commondialog-showprinter/m-p/1491209#M38872</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-11-18T23:38:09Z</dc:date>
    </item>
    <item>
      <title>Re: CommonDialog - ShowPrinter</title>
      <link>https://forums.autodesk.com/t5/vba-forum/commondialog-showprinter/m-p/1491210#M38873</link>
      <description>What error/behavior exactly are you getting? As far as i know, you can't use&lt;BR /&gt;
the CommonDialog control in vba apps....&lt;BR /&gt;
&lt;BR /&gt;
-Chris&lt;BR /&gt;
&lt;BR /&gt;
"MadCAD" &lt;INFO&gt; wrote in message&lt;BR /&gt;
news:5018123@discussion.autodesk.com...&lt;BR /&gt;
Does enyone know why "Page Setup" dialog does not return the right PaperSize&lt;BR /&gt;
and the Orientation that user changes. Here is the code:&lt;BR /&gt;
&lt;BR /&gt;
Private Sub Command1_Click()&lt;BR /&gt;
&lt;BR /&gt;
    On Error Resume Next&lt;BR /&gt;
&lt;BR /&gt;
    With Printer&lt;BR /&gt;
        MsgBox "DeviceName:" &amp;amp; vbTab &amp;amp; .DeviceName &amp;amp; vbLf &amp;amp; _&lt;BR /&gt;
                      "PaperSize:" &amp;amp; vbTab &amp;amp; .PaperSize &amp;amp; vbLf &amp;amp; _&lt;BR /&gt;
                      "Orientation:" &amp;amp; vbTab &amp;amp; .Orientation&lt;BR /&gt;
        End With&lt;BR /&gt;
&lt;BR /&gt;
    With CommonDialog1&lt;BR /&gt;
        .CancelError = True&lt;BR /&gt;
        .Flags = cdlPDNoSelection + _&lt;BR /&gt;
                     cdlPDPageNums + _&lt;BR /&gt;
                     cdlPDDisablePrintToFile + _&lt;BR /&gt;
                     cdlPDPrintSetup ' + _&lt;BR /&gt;
                     cdlPDNoWarning&lt;BR /&gt;
        .ShowPrinter&lt;BR /&gt;
&lt;BR /&gt;
        If Err Then&lt;BR /&gt;
            If Err.Number = 32755 Then&lt;BR /&gt;
                Exit Sub&lt;BR /&gt;
            Else&lt;BR /&gt;
                MsgBox Err.Number &amp;amp; " : " &amp;amp; Err.Description&lt;BR /&gt;
            End If&lt;BR /&gt;
        End If&lt;BR /&gt;
    End With&lt;BR /&gt;
&lt;BR /&gt;
    With Printer&lt;BR /&gt;
        MsgBox "DeviceName:" &amp;amp; vbTab &amp;amp; .DeviceName &amp;amp; vbLf &amp;amp; _&lt;BR /&gt;
                      "PaperSize:" &amp;amp; vbTab &amp;amp; .PaperSize &amp;amp; vbLf &amp;amp; _&lt;BR /&gt;
                      "Orientation:" &amp;amp; vbTab &amp;amp; .Orientation&lt;BR /&gt;
    End With&lt;BR /&gt;
&lt;BR /&gt;
End Sub&lt;/INFO&gt;</description>
      <pubDate>Mon, 21 Nov 2005 16:48:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/commondialog-showprinter/m-p/1491210#M38873</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-11-21T16:48:49Z</dc:date>
    </item>
    <item>
      <title>Re: CommonDialog - ShowPrinter</title>
      <link>https://forums.autodesk.com/t5/vba-forum/commondialog-showprinter/m-p/1491211#M38874</link>
      <description>I'm using it in a VB application. There is NO specific error message.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
To check what I'm talking about, run a new vb project, add MS Common Dialog&lt;BR /&gt;
ActiveX reference to your project and add one CommonDialog1 control to the&lt;BR /&gt;
project. Add one command button too. Copy and paste the code I had on my 1st&lt;BR /&gt;
post. Run the project and click the command button. Pay attention to the 1st&lt;BR /&gt;
message. Then made some changes on the printer dialog box; say, change the&lt;BR /&gt;
printer, the paper and the layout options. Accept it. Now compare your 1st&lt;BR /&gt;
and the current message. Paper and orientation options did not take changes.&lt;BR /&gt;
This is what I'm talking about.&lt;BR /&gt;
&lt;BR /&gt;
This weekend, I found that all MSDN documentations, plus most web vb&lt;BR /&gt;
"advisers" suggest that this is a driver related issue, but I never seen&lt;BR /&gt;
this control worked since I'm programming  w/ vb (1997), in all systems I&lt;BR /&gt;
used to work. I have one word for this control: useless, if not bal..it. The&lt;BR /&gt;
solution I see is in direct device contexts access.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
"Chris Shoemaker" &lt;CSS&gt; wrote in message&lt;BR /&gt;
news:5019094@discussion.autodesk.com...&lt;BR /&gt;
What error/behavior exactly are you getting? As far as i know, you can't use&lt;BR /&gt;
the CommonDialog control in vba apps....&lt;BR /&gt;
&lt;BR /&gt;
-Chris&lt;BR /&gt;
&lt;BR /&gt;
"MadCAD" &lt;INFO&gt; wrote in message&lt;BR /&gt;
news:5018123@discussion.autodesk.com...&lt;BR /&gt;
Does enyone know why "Page Setup" dialog does not return the right PaperSize&lt;BR /&gt;
and the Orientation that user changes. Here is the code:&lt;BR /&gt;
&lt;BR /&gt;
Private Sub Command1_Click()&lt;BR /&gt;
&lt;BR /&gt;
    On Error Resume Next&lt;BR /&gt;
&lt;BR /&gt;
    With Printer&lt;BR /&gt;
        MsgBox "DeviceName:" &amp;amp; vbTab &amp;amp; .DeviceName &amp;amp; vbLf &amp;amp; _&lt;BR /&gt;
                      "PaperSize:" &amp;amp; vbTab &amp;amp; .PaperSize &amp;amp; vbLf &amp;amp; _&lt;BR /&gt;
                      "Orientation:" &amp;amp; vbTab &amp;amp; .Orientation&lt;BR /&gt;
        End With&lt;BR /&gt;
&lt;BR /&gt;
    With CommonDialog1&lt;BR /&gt;
        .CancelError = True&lt;BR /&gt;
        .Flags = cdlPDNoSelection + _&lt;BR /&gt;
                     cdlPDPageNums + _&lt;BR /&gt;
                     cdlPDDisablePrintToFile + _&lt;BR /&gt;
                     cdlPDPrintSetup ' + _&lt;BR /&gt;
                     cdlPDNoWarning&lt;BR /&gt;
        .ShowPrinter&lt;BR /&gt;
&lt;BR /&gt;
        If Err Then&lt;BR /&gt;
            If Err.Number = 32755 Then&lt;BR /&gt;
                Exit Sub&lt;BR /&gt;
            Else&lt;BR /&gt;
                MsgBox Err.Number &amp;amp; " : " &amp;amp; Err.Description&lt;BR /&gt;
            End If&lt;BR /&gt;
        End If&lt;BR /&gt;
    End With&lt;BR /&gt;
&lt;BR /&gt;
    With Printer&lt;BR /&gt;
        MsgBox "DeviceName:" &amp;amp; vbTab &amp;amp; .DeviceName &amp;amp; vbLf &amp;amp; _&lt;BR /&gt;
                      "PaperSize:" &amp;amp; vbTab &amp;amp; .PaperSize &amp;amp; vbLf &amp;amp; _&lt;BR /&gt;
                      "Orientation:" &amp;amp; vbTab &amp;amp; .Orientation&lt;BR /&gt;
    End With&lt;BR /&gt;
&lt;BR /&gt;
End Sub&lt;/INFO&gt;&lt;/CSS&gt;</description>
      <pubDate>Mon, 21 Nov 2005 19:09:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/commondialog-showprinter/m-p/1491211#M38874</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-11-21T19:09:48Z</dc:date>
    </item>
    <item>
      <title>Re: CommonDialog - ShowPrinter</title>
      <link>https://forums.autodesk.com/t5/vba-forum/commondialog-showprinter/m-p/1491212#M38875</link>
      <description>As you are probably aware, the commondialog control doesn't have a .PaperSize and a&lt;BR /&gt;
.PaperSource property but it does have an .Orientation property.  So, at least, you should&lt;BR /&gt;
be able to set the printer's orientation thus:&lt;BR /&gt;
&lt;BR /&gt;
    With CommonDialog1&lt;BR /&gt;
        ....&lt;BR /&gt;
        .ShowPrinter&lt;BR /&gt;
        Printer.Orientation = .Orientation&lt;BR /&gt;
       ...</description>
      <pubDate>Mon, 21 Nov 2005 19:43:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/commondialog-showprinter/m-p/1491212#M38875</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-11-21T19:43:55Z</dc:date>
    </item>
    <item>
      <title>Re: CommonDialog - ShowPrinter</title>
      <link>https://forums.autodesk.com/t5/vba-forum/commondialog-showprinter/m-p/1491213#M38876</link>
      <description>At first I didn't think your method was possible but try looking here:&lt;BR /&gt;
&lt;BR /&gt;
http://www.vbwm.com/forums/topic.asp?TOPIC_ID=4006&lt;BR /&gt;
http://support.microsoft.com/default.aspx?scid=kb%3Ben-us%3B322710</description>
      <pubDate>Mon, 21 Nov 2005 20:41:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/commondialog-showprinter/m-p/1491213#M38876</guid>
      <dc:creator>GTVic</dc:creator>
      <dc:date>2005-11-21T20:41:45Z</dc:date>
    </item>
    <item>
      <title>Re: CommonDialog - ShowPrinter</title>
      <link>https://forums.autodesk.com/t5/vba-forum/commondialog-showprinter/m-p/1491214#M38877</link>
      <description>Also,&lt;BR /&gt;
CommonDialog only can change the printer name (the printer object) but&lt;BR /&gt;
nothing more, although there are many options come with offered dialog boxes&lt;BR /&gt;
(print, page setup).&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
"Allen Johnson" &lt;AJOHNSON&gt; wrote in message&lt;BR /&gt;
news:5019302@discussion.autodesk.com...&lt;BR /&gt;
As you are probably aware, the commondialog control doesn't have a&lt;BR /&gt;
.PaperSize and a&lt;BR /&gt;
.PaperSource property but it does have an .Orientation property.  So, at&lt;BR /&gt;
least, you should&lt;BR /&gt;
be able to set the printer's orientation thus:&lt;BR /&gt;
&lt;BR /&gt;
    With CommonDialog1&lt;BR /&gt;
        ....&lt;BR /&gt;
        .ShowPrinter&lt;BR /&gt;
        Printer.Orientation = .Orientation&lt;BR /&gt;
       ...&lt;/AJOHNSON&gt;</description>
      <pubDate>Mon, 21 Nov 2005 23:38:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/commondialog-showprinter/m-p/1491214#M38877</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-11-21T23:38:55Z</dc:date>
    </item>
    <item>
      <title>Re: CommonDialog - ShowPrinter</title>
      <link>https://forums.autodesk.com/t5/vba-forum/commondialog-showprinter/m-p/1491215#M38878</link>
      <description>Here is the controdictary featurtures w/ CommonDialog:&lt;BR /&gt;
&lt;BR /&gt;
From a user point of view the printer may be configured for a particular&lt;BR /&gt;
application with its&lt;BR /&gt;
Name, PaperSize, Orientation, Colored/Grayscale print, Tray/Outotray&lt;BR /&gt;
options.&lt;BR /&gt;
&lt;BR /&gt;
Now look how CommonDialog works&lt;BR /&gt;
1. Directly changes the printer&lt;BR /&gt;
2. Returns orientatioin value&lt;BR /&gt;
&lt;BR /&gt;
Very poor performance.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
"MadCAD" &lt;INFO&gt; wrote in message&lt;BR /&gt;
news:5019578@discussion.autodesk.com...&lt;BR /&gt;
Also,&lt;BR /&gt;
CommonDialog only can change the printer name (the printer object) but&lt;BR /&gt;
nothing more, although there are many options come with offered dialog boxes&lt;BR /&gt;
(print, page setup).&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
"Allen Johnson" &lt;AJOHNSON&gt; wrote in message&lt;BR /&gt;
news:5019302@discussion.autodesk.com...&lt;BR /&gt;
As you are probably aware, the commondialog control doesn't have a&lt;BR /&gt;
.PaperSize and a&lt;BR /&gt;
.PaperSource property but it does have an .Orientation property.  So, at&lt;BR /&gt;
least, you should&lt;BR /&gt;
be able to set the printer's orientation thus:&lt;BR /&gt;
&lt;BR /&gt;
    With CommonDialog1&lt;BR /&gt;
        ....&lt;BR /&gt;
        .ShowPrinter&lt;BR /&gt;
        Printer.Orientation = .Orientation&lt;BR /&gt;
       ...&lt;/AJOHNSON&gt;&lt;/INFO&gt;</description>
      <pubDate>Mon, 21 Nov 2005 23:46:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/commondialog-showprinter/m-p/1491215#M38878</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-11-21T23:46:36Z</dc:date>
    </item>
  </channel>
</rss>

