print copies,get paper size

Posted by: sofial on 8 September 2017, 2:35 pm EST

  • Posted 8 September 2017, 2:35 pm EST

    in version 4.0.3509.2008 after print 2 copies I get the error


    null reference exception


    is there an update that i can use?


    how can i get the paper size from dialog box? 


    thanks

  • Replied 8 September 2017, 2:35 pm EST

    Hello,

    To get the paper size from printdialog you may use

    MsgBox(PrintDialog1.PrinterSettings.PaperSizes(0).Kind.ToString)

    You may upgrade to out latest build for Spread 4 here.

    Thanks,

     

     

  • Replied 8 September 2017, 2:35 pm EST

    PrintDialog1.PrinterSettings.PaperSizes(0) returns the first kind on the list


    can i get the selected?


    thnx again

  • Replied 8 September 2017, 2:35 pm EST

    Hello,

    You may use any index in place of "0", here is the code that gives you information about the papersize.

    Dim ps As New PrinterSettings()

            For Each psize As PaperSize In ps.PaperSizes

                Dim str1 As String = psize.Kind.ToString()

                Dim str2 As String = psize.PaperName.ToString()

                Dim str3 As String = psize.Height.ToString()

                Dim str4 As String = psize.Width.ToString()

            Next

    Thanks,

     

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels