printing

  • Thread starter Thread starter Penny175
  • Start date Start date
P

Penny175

I developed a form with fillable sections for others to complete. When I
print the document, I want any section that didn't get completed to not have
typing "click here to enter text." on the printed version.

Thanks in advance
 
You will need a macro to do that. Given your description it appears that you
have used Word 2007 content controls. The following will hide the contents
when run, print the document then unhide them again. Your problem now will
be to get users to run the macro. You cannot force users to run macros
against their better judgement.

Sub PrintForm()
Dim oDoc As Document
Dim sText As String
Dim bHidden As Boolean
Set oDoc = ActiveDocument
Dim oCC As ContentControl
bHidden = ActiveWindow.View.ShowHiddenText
ActiveWindow.View.ShowHiddenText = False
For Each oCC In oDoc.ContentControls
If InStr(1, oCC.Range.Text, "Click here") Then
oCC.Range.Font.Hidden = True
End If
Next oCC
oDoc.PrintOut
ActiveWindow.View.ShowHiddenText = True
For Each oCC In oDoc.ContentControls
oCC.Range.Font.Hidden = False
Next oCC
ActiveWindow.View.ShowHiddenText = bHidden
End Sub

http://www.gmayor.com/installing_macro.htm

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
Back
Top