PDA

View Full Version : Solved: Format Text so it Doesn't Print



TButhe
02-17-2005, 02:50 PM
Is there anyway to format text so that it won't print? I tried using hidden text but my users would freak if they had to deal with the paragraph markers. I just want to have a form field with a little text next to, above, below or wherever that tells them what to put in the field. They would never see the help on the status bar either. (These are people that use the computer very, very little.) Am I missing something in Word? I have searched the knowledge base and thru several books and can't seem to find any solution. :help :beg:

Any suggestions, PLEASE!! : pray2:

fumei
02-17-2005, 03:12 PM
If I understand correctly, you want text beside a form field that explains what to put in the form field; then, when printing, you want that text to disappear.

Here is one way - there are others. This depends on the original document is not saved with the changes. In other words to keep this viable, you also need a routine that will save the document (with the stuff the user input) as a different file. OK?

1. Type in the text you want beside your form field.
2. Select that text. Make sure you select everything including spaces that you want to disappear.
3. Insert > Bookmarks
4. Type a name for the bookmark. If you are doing a number of these, I suggest a short generic name, with a incremented number. Say NoPrint1.
5. Repeat as needed. Make the next one NoPrint2, NoPrint3 etc.
6. When done, you can dump the bookmarks with something like:
Sub dumpBM()
Dim aBook As Bookmark
For Each aBook In ActiveDocument.Bookmarks
If Left(aBook.Name, 7) = "NoPrint" Then aBook.Range.Delete
Next
End Sub

This goes through all your bookmarks, checks if the name has the first 7 characters = "NoPrint" - and obviously if you used a different naming convention you have to adjust this. If it does, it deletes the Range of it. this completely removes the text AND the bookmark.

This is why it is important to save the document as a another name. better yet, make this a template.

You can run the dumping code as a OnExit macro from your last form field; or perhaps as part of a file save routine, or rewrite the FilePrint command to run it first.

TButhe
02-17-2005, 03:30 PM
Thanks!!! :clap2:That looks exactly like what I am looking for but now I won't be able to try it out until Monday! I will check it out and post back with the results. Thanks for super fast response!!

TButhe
02-21-2005, 10:22 AM
That works Fantastic!!!! I know I will get alot of use out of this little bit of code. THANKS!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
:bow:

fumei
02-22-2005, 10:21 AM
You are welcome.