在调用前通过代码设置打印属性
解决方案 »
- MDI窗体如何判断所有子窗口都已关闭,然后就自动整个MDI退出?
- 原来的QQ消息群发器,在2008中不能用了
- 水晶报表如何刷新数据
- 怎么样让打印机横向打印?
- 我想设计一个窗体,象QQ那样的,一靠到屏幕上方,就缩上去,鼠标一指,就自动拉下来,如何实现?
- 如何操作 保存在变量里的 XML 文档
- 怎么利用安装到电脑中的软件,制作安装盘?(原来的代码和安装盘已经找不到,但是电脑中安装有)
- 如何取得CPU型号?!!急哟
- VB datareport 报表生成问题!高分求解决方法
- mediaplayer的播放文件时候的问题100
- 关于打印窗体中内容,其中有一个MSFLex控件,还有文本框(所有分都给)
- 关于绘图的问题
ex1.Selection.Borders(xlInsideHorizontal).LineStyle = 1
ex1.Selection.Borders(xlInsideVertical).LineStyle = 1
With ex1.Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With ex1.Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With ex1.Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With ex1.Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With ex1.Selection.Borders(xlInsideVertical)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With ex1.Selection.Borders(xlInsideHorizontal)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
With ex1.ActiveSheet.PageSetup
.PrintTitleRows = ""
.PrintTitleColumns = ""
End Withex1.ActiveSheet.PageSetup.PrintArea = "" '这里以下设置打印页面的上.下.左.右边距,打印方向(这里设置为横向),纸张(这里设置为A4纸)
With ex1.ActiveSheet.PageSetup
.LeftHeader = ""
.CenterHeader = ""
.RightHeader = ""
.LeftFooter = ""
.CenterFooter = ""
.RightFooter = ""
.LeftMargin = ex1.Application.InchesToPoints(0.593)
.RightMargin = ex1.Application.InchesToPoints(0.393)
.TopMargin = ex1.Application.InchesToPoints(0.393)
.BottomMargin = ex1.Application.InchesToPoints(0.393)
.HeaderMargin = 0.5
.FooterMargin = 0.5
.PrintHeadings = False
.PrintGridlines = False
.PrintComments = 1
.PrintQuality = 600
.CenterHorizontally = False
.CenterVertically = False
.Orientation = 2
.Draft = False
.PaperSize = vbPRPSA4
.FirstPageNumber = 2
.Order = 2
.BlackAndWhite = False
.Zoom = 100
.PrintErrors = xlPrintErrorsDisplayed
End With