我设置了一个背景图像为8.5x11的简历(如果需要,可以将其设置为水印)。现在,我想设置它,这样它就不会自动打印背景图像,这样雇主就不需要跳槽了。在网上查看后,我注意到这可能是必须使用VBA和模板设置的东西。任何insite或任何愿意解决这个问题的人都会非常感激。
很大程度上,我只是希望我的Word文档不打印图像或水印,而不让打印它的人设置任何东西。(不必两者都有)
发布于 2012-05-22 07:57:41
你真的需要VBA来做这个吗?
要在Word 2010中禁用背景颜色和图像的打印,只需执行以下步骤
单击文件|选项
您将看到一个"Word选项“对话框。
在显示选项卡下,只需取消选中“打印BackGround颜色和图像”
发布于 2013-01-18 07:19:05
不知道为什么,但这个男人工作得很好。
Public WithEvents appWord As Word.Application
Private Sub Document_Open()
Set appWord = Application
' Not sure if your image is a shape or inlineshape, so...
If ThisDocument.Shapes.Count Then
' First Shape is now visible
ThisDocument.Shapes(1).Visible = msoTrue
ElseIf ThisDocument.InlineShapes.Count Then
' First inlineshpae has medium brightness
ThisDocument.InlineShapes.Item(1).PictureFormat.Brightness = 0.5
End If
End Sub
Private Sub appWord_DocumentBeforePrint(ByVal Doc As Document, Cancel As Boolean)
Dim intResponse As Integer
intResponse = MsgBox("This document contains a background image. " & _
"Would you like to hide it before printing?", vbYesNo, _
"Hide Background Image?")
If intResponse = vbYes Then
hide_images
ElseIf intResponse = vbNo Then
show_images
End If
End Sub
Sub hide_images()
Application.DisplayStatusBar = True
With ActiveWindow
.DisplayHorizontalScrollBar = True
.DisplayVerticalScrollBar = True
.DisplayLeftScrollBar = False
.StyleAreaWidth = CentimetersToPoints(0)
.DisplayVerticalRuler = True
.DisplayRightRuler = False
.DisplayScreenTips = True
With .View
.ShowAnimation = True
.Draft = False
.WrapToWindow = False
.ShowPicturePlaceHolders = False
.ShowFieldCodes = False
.ShowBookmarks = False
.FieldShading = wdFieldShadingWhenSelected
.ShowTabs = False
.ShowSpaces = False
.ShowParagraphs = False
.ShowHyphens = False
.ShowHiddenText = False
.ShowAll = True
.ShowDrawings = True
.ShowObjectAnchors = False
.ShowTextBoundaries = False
.ShowHighlight = True
End With
End With
With Options
.UpdateFieldsAtPrint = False
.UpdateLinksAtPrint = False
.DefaultTray = "Druckereinstellungen verwenden"
.PrintBackground = True
.PrintProperties = False
.PrintFieldCodes = False
.PrintComments = False
.PrintHiddenText = False
.PrintDrawingObjects = False
.PrintDraft = False
.PrintReverse = False
.MapPaperSize = True
End With
With ActiveDocument
.PrintPostScriptOverText = False
.PrintFormsData = False
End With
End Sub
Sub show_images()
With Options
.UpdateFieldsAtPrint = False
.UpdateLinksAtPrint = False
.DefaultTray = "Druckereinstellungen verwenden"
.PrintBackground = True
.PrintProperties = False
.PrintFieldCodes = False
.PrintComments = False
.PrintHiddenText = False
.PrintDrawingObjects = True
.PrintDraft = False
.PrintReverse = False
.MapPaperSize = True
End With
With ActiveDocument
.PrintPostScriptOverText = False
.PrintFormsData = False
End With
End Sub干杯mARTin
发布于 2013-01-30 00:24:26
我使用以下(简短)过程作为功能区扩展,用于在文档标题中显示/隐藏徽标,以便用户可以在打印/pdf创建之前进行切换。
Sub ShowHideLogoInHeader本地错误处理程序(非关键)
On Local Error GoTo ErrHandler暗淡的形状范围
Dim myStory As ShapeRange
Set myStory = ActiveDocument.StoryRanges(wdFirstPageHeaderStory).ShapeRange
myStory.Visible = Not myStory.Visible
Exit SubErrHandler: debug中报告错误(独立函数)
ReportError "modRibbon - ToonOfVerbergLogo"
Err.Clear
End Subhttps://stackoverflow.com/questions/10693859
复制相似问题