我无法为我的打印部分设置页边距。当我执行marco时,总是以默认边距而不是我设置的边距弹出打印预览。
'Setup print stuff, print and delete the worksheet
With newSheet
With PageSetup
.PaperSize = xlPaperA4
.BlackAndWhite = True
.LeftMargin = Application.InchesToPoints(0.2)
End With
'Use PrintPreview for Debugging
.PrintPreview
.Delete
End With
我看不到我在做什么错。有什么建议?
如何使用:
With .PageSetup
代替
With PageSetup
以后编辑
嵌套With .PageSetup
将引用PageSetup
外部With
对象(即newSheet
)的属性。如果没有点,则引用一个PageSetup属性,该属性可能适用于其他一些(当前处于活动状态)对象。
有关MSDN的更多信息:http : //msdn.microsoft.com/zh-cn/library/wc500chb.aspx(最后一个示例)
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句