Hide text in MSWord 2013 using macro

Joined
Dec 12, 2016
Messages
1
Reaction score
0
Hey everyone,
I am wanting to make a word document for a friend of mine kind of a surprise gift to her. I was wanting to create a document that would hide the text until a certain date was true or if the correct password was entered. I was thinking I could use an ActiveX checkbox that when checked it would prompt her with a message saying "document section is visible at xx/xx/xxxx or type in password: "
I was planing on using a simple If then statement with the hideselection = true or false depending if the datevalue matched the date. However, I am very new to programming in VBA, so if anyone knows any information that would help me achieve this or the projects probability I would be very grateful.
Thanks and Happy Holidays!
 

macropod

Microsoft MVP
Joined
Mar 2, 2012
Messages
580
Reaction score
50
You can't reliably hide text that way in Word. Simply formatting it has hidden doesn't mean the other person won't be able to see - or print (even without seeing) - the hidden text. That's because Word's hidden text display and print settings are controlled by the users Word configuration. For example, simply clicking on the ¶ symbol on the Ribbon's home tab will toggle hidden text display on/off. That said, there are ways to conditionally dislpay/print content. See, for example, Use Date (And/Or Time) Comparisons To Vary Text in my Microsoft Word Date Calculation Tutorial, at:
http://windowssecrets.com/forums/showthread.php/154368-Microsoft-Word-Date-Calculation-Tutorial
or:
http://www.gmayor.com/downloads.htm#Third_party
Do read the document's introductory material.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top