Excel VBA打印页边距似乎被忽略

低的

我无法为我的打印部分设置页边距。当我执行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] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章