Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6579529
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T15:54:35+00:00 2026-05-25T15:54:35+00:00

is it possible to put a password on a single word inside a word

  • 0

is it possible to put a password on a single word inside a word document?

What I want is to write a system documentation from our IT structure. I want to put the passwords in the document as well. Now I want that you have to enter a “MASTER” password in order to unlock to passwords inside the document. If you do not enter the password, the passwords inside the document should be invisible or something like that.

Is that possible?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T15:54:36+00:00Added an answer on May 25, 2026 at 3:54 pm

    Yes, this is possible. To make this work we have to use a combination of Word’s inherent document protection, its hidden text attribute, and a couple of VBA tricks.

    First, format all the passwords in the document as hidden text. (For those who are unfamiliar, hidden text is only visible when the Show/Hide function is set to true.)

    Then add code to make sure that the hidden text will not display and also to protect the document from being edited whenever the document is opened:

    Private Sub Document_Open()
    AddProtection
    End Sub
    
    Sub AddProtection()
    With ActiveDocument
        .ActiveWindow.View.ShowAll = False
        .ActiveWindow.View.ShowHiddenText = False
        .Application.Options.PrintHiddenText = False
        .Protect Type:=wdAllowOnlyReading, NoReset:=True, Password:="DesiredPassword"
    End With
    End Sub
    

    Because Word users can normally display hidden text at any given time, we also need to take control of this function. Most menu and Ribbon commands can be intercepted by creating a module containing subroutines named for the intercepted commands. Naming a Sub ShowAll will allow us to control this function and only display hidden text when a password is entered:

    Sub ShowAll()
    
    If ActiveDocument.ProtectionType = wdAllowOnlyReading Then
        'Do nothing
    Else 'restore the Ribbon's toggle function
        If ActiveDocument.ActiveWindow.View.ShowAll = True Then
            ActiveDocument.ActiveWindow.View.ShowAll = False
        Else
            ActiveDocument.ActiveWindow.View.ShowAll = True
        End If
    End If
    
    End Sub
    

    Finally, we add some code to prompt the user for a password and, if entered correctly, display the text that was formerly hidden:

    Sub RemoveProtection()
    
    Dim strPassword As String
    strPassword = InputBox("Enter document password.")
    ActiveDocument.Unprotect Password:=strPassword
    If ActiveDocument.ProtectionType = wdNoProtection Then
        ActiveDocument.ActiveWindow.View.ShowHiddenText = True
    End If
    
    End Sub
    

    Once all the VBA code is entered, right-click on the module in the IDE, select Project Properties, and assign a separate password on the Protection tab. This will stop power users from getting to the embedded password or changing the code.

    All that’s left to do is create a QAT button in Word (that is only visible for this document) and assign the RemoveProtection sub to it. Whenever the document is opened the passwords will be hidden and protected from editing, but can then be revealed by clicking on the QAT button and entering the correct password.

    EDIT

    When I first answered this question, I failed to consider that Word has a hidden text option that can be turned on separateley from the Show All option. Additionally, hidden text can be printed via a printing option. I have added code in AddProtection above to turn off these settings.

    Further testing also revealed that a user in Word 2007 could manually go into Office Orb|Options|Display to reveal the hidden text by changing the Show all formatting marks or Hidden text options manually. To avoid this, a Ribbon customization would need to be created and loaded with the document.

    Finally, it is worth noting that although it is great fun to bend Word to one’s will in order to make it accomplish tasks like this, the level of protection is not as good as encrypting the passwords separately and then unecrypting before revealing the contents or even using Word’s document password feature to encrypt the document’s entire contents.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is it possible to put the results from more than one query on more
Possible Duplicate: How many Python classes should I put in one file? Coming from
Is it possible to somehow mark a System.Array as immutable. When put behind a
I have put htaccess password in root of my domain. Now i want to
Is it possible put an user control inside a doument viewer? If possible, how
Is is possible to put a constant where clause to a Linq to SQl
Is it possible to put a macro in a macro in c++? Something like:
Based on a simple test I ran, I don't think it's possible to put
Possible Duplicate: PHP detecting request type (GET, POST, PUT or DELETE) This should be
Is it possible for me to build my own version of android and put

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.