在vb中怎么设置excel文件的打印格式? 包括 横打 纵打 打印比例 字体等我用commondialog设置结果并没有按照设置打印我用了CommonDialog1.PrinterDefault = True但是没有用大虾指教! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 用Excel的录制宏功能将你想要的操作生成宏代码稍加修改就可以了 工程->引用->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 菜籽跪问 VB中如何将时间作为输出数据文件的文件名 怎样点窗体上的关闭弹出询问窗口? 如何解决word中表达式计算结果有效数字问题 怎么判断是最后一条记录 循环显示时 请教:VB6如何连接ACCESS2000数据库?不要用控件。 关于vb中水晶报表传递数据源参数的问题 无题 不要笑我,我很菜鸟的!帮个忙了 DC转换为Binary? 参与者都给分 没人懂软件测试吗!!???怎么测试软件!!大侠们!!谢谢!!! 用VB遍了个记事本,有个设置字体的功能,运行时老提示要求安装字体,怎么回事?
将你想要的操作生成宏代码
稍加修改就可以了
.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