Consulting

Results 1 to 5 of 5

Thread: Solved: Format Text so it Doesn't Print

  1. #1
    VBAX Regular TButhe's Avatar
    Joined
    Sep 2004
    Location
    Sioux Falls, SD
    Posts
    64
    Location

    Question Solved: Format Text so it Doesn't Print

    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.

    Any suggestions, PLEASE!!
    Thanks,
    Tracy

  2. #2
    VBAX Wizard
    Joined
    May 2004
    Posts
    6,713
    Location
    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:
    [vba]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[/vba]

    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.

  3. #3
    VBAX Regular TButhe's Avatar
    Joined
    Sep 2004
    Location
    Sioux Falls, SD
    Posts
    64
    Location
    Thanks!!! 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!!
    Thanks,
    Tracy

  4. #4
    VBAX Regular TButhe's Avatar
    Joined
    Sep 2004
    Location
    Sioux Falls, SD
    Posts
    64
    Location
    That works Fantastic!!!! I know I will get alot of use out of this little bit of code. THANKS!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    Thanks,
    Tracy

  5. #5
    VBAX Wizard
    Joined
    May 2004
    Posts
    6,713
    Location
    You are welcome.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •