包括 横打 纵打 打印比例 字体等我用commondialog设置结果并没有按照设置打印我用了CommonDialog1.PrinterDefault = True但是没有用大虾指教!

解决方案 »

  1.   

    用Excel的录制宏功能
    将你想要的操作生成宏代码
    稍加修改就可以了
      

  2.   

    工程->引用->Microsoft Excel 9.0 Ojbect Library (后面为版本号)Dim exlApp as New Excel.Application然后到EXCEL中录制宏~!!!!,这是代码!!With ActiveSheet.PageSetup
            .PrintTitleRows = ""
            .PrintTitleColumns = ""
        End With
        ActiveSheet.PageSetup.PrintArea = ""
        With ActiveSheet.PageSetup
            .LeftHeader = ""
            .CenterHeader = ""
            .RightHeader = ""
            .LeftFooter = ""
            .CenterFooter = ""
            .RightFooter = ""
            .LeftMargin = Application.InchesToPoints(0.75)
            .RightMargin = Application.InchesToPoints(0.75)
            .TopMargin = Application.InchesToPoints(1)
            .BottomMargin = Application.InchesToPoints(1)
            .HeaderMargin = Application.InchesToPoints(0.5)
            .FooterMargin = Application.InchesToPoints(0.5)
            .PrintHeadings = False
            .PrintGridlines = False
            .PrintComments = xlPrintNoComments
            .PrintQuality = 600
            .CenterHorizontally = False
            .CenterVertically = False
            .Orientation = xlLandscape
            .Draft = False
            .PaperSize = xlPaperA4
            .FirstPageNumber = xlAutomatic
            .Order = xlDownThenOver
            .BlackAndWhite = False
            .Zoom = 100
        End With