A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Word » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Hide placeholder text if nothing is entered



 
 
Thread Tools Display Modes
  #1  
Old March 30th, 2010, 08:00 PM posted to microsoft.public.word.newusers
RachelT
external usenet poster
 
Posts: 2
Default Hide placeholder text if nothing is entered

Totally new user to Word as a Form tool - I have created a form with various
fields that may or may not be filled out depending upon the number of
applicants. Can I not print the placeholder text if nothing is entered in
the space?
Thank you!
  #2  
Old March 31st, 2010, 03:27 AM posted to microsoft.public.word.newusers
Jay Freedman
external usenet poster
 
Posts: 9,488
Default Hide placeholder text if nothing is entered

On Tue, 30 Mar 2010 12:00:01 -0700, RachelT
wrote:

Totally new user to Word as a Form tool - I have created a form with various
fields that may or may not be filled out depending upon the number of
applicants. Can I not print the placeholder text if nothing is entered in
the space?
Thank you!


Add the following macro to the template for the form (see
http://www.gmayor.com/installing_macro.htm if needed). It changes the
color of the placeholder to white, prints, and then restores the
color.

Sub FilePrint()
Dim cc As ContentControl
Dim col As Long

With ActiveDocument

' hide placeholders
For Each cc In .ContentControls
If cc.ShowingPlaceholderText Then
col = cc.Range.Font.Color
cc.Range.Font.Color = wdColorWhite
End If
Next

Dialogs(wdDialogFilePrint).Show

For Each cc In .ContentControls
If cc.ShowingPlaceholderText Then
cc.Range.Font.Color = col
End If
Next

End With
End Sub


--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit.
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 04:12 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.