【发布时间】:2017-06-02 21:03:11
【问题描述】:
我有一个文本框,里面有两个命令按钮,我不想在打印时显示它们。我已将下面列出的代码放在 FilePrint 和 FilePrintDefault Word 命令中。如果我使用快速打印按钮进行打印,它可以完美运行并且不打印。但是,如果我使用 Ctrl+P 打印并打开打印对话框,则会打印文本框。如何设置它,以便无论您如何打印,文本框都不会打印?这是几个人会使用的套用信函,所以我不能只为每个人更改 Word 打印设置,这就是我使用宏的原因。
Sub FilePrint() ' ' FilePrint Macro ' Prints the active document '
With ActiveDocument
.Shapes(1).Visible = msoFalse
.PrintOut Background:=False
.Shapes(1).Visible = msoTrue
End With
End Sub
Sub FilePrintDefault() ' ' FilePrintDefault Macro ' Prints the active document using the current defaults '
With ActiveDocument
.Shapes(1).Visible = msoFalse
.PrintOut Background:=False
.Shapes(1).Visible = msoTrue
End With
End Sub
【问题讨论】:
-
您是否尝试在两个函数中都设置断点?
-
...谷歌搜索断点...
-
代码中F9设置断点
-
好的,通过断点运行代码会打印没有图像的文档,但是当我使用 Ctrl + P 打印时,它仍然会打印图像。