SOLVED

"Always show hidden text" - How to force OFF permanently, or create shortcut to reset easily??

Copper Contributor

We are using Lexis Affinity software which keeps ticking the "always show hidden text box" in our Word profiles.  In our office we use many letter precedents with hidden text, but staff are unable to hide it when this setting is on.

 

Is there a way to PREVENT Affinity from changing this setting (ie. to force it to always be unticked and unable to be changed)?

 

Failing that, is there a way to set up a keyboard shortcut/ribbon button so users can at least rectify the situation quickly and easily?

 

It happens all the time and is incredibly frustrating.  We would be so grateful for any assistance!

10 Replies
best response confirmed by Kazran (Copper Contributor)
Solution

@Kazran 

You can install the following macro in each user's Normal.dotm template (or another .dotm template stored in the folder %appdata%\Microsoft\Word\STARTUP), and assign a shortcut and/or Quick Access Toolbar button to run it:

 

Sub HideHiddenText()
     ActiveWindow.View.ShowHiddenText = False
End Sub

 

If the documents open with hidden text showing, you can make a copy of the same macro with "HideHiddenText" replaced by "AutoOpen", which will automatically execute each time a document is opened.

Hi @Jay Freedman 

 

Thank you SO much for your response.  The first snippet of code you proposed is almost identical to what we have running immediately after a document is merged from the template (attached to the document via the Affinity merge engine, not the user's Normal).

 

Unfortunately revisiting these documents later will result in the problem occurring, which is hopefully what your second suggestion can overcome. 

 

Just so I'm clear, AutoOpen(), when attached to every user's Normal (or to our shared Global template), will automatically run whatever code it contains every single time a Word doc is opened?  And this is independent of the document type, any other macros that may be present, and the type of template it was originally merged from (.dotm, .dotx, etc.)?

 

I'm fuzzy on how this all works but very excited about any possible work-arounds after dealing with it for so long!  Just want to make sure I'm clear before I take it to our IT guys.

 

@Kazran 

Your assumption is correct. The macro name AutoOpen is a special one; if that macro exists in the Normal template or in any *.dotm template stored in the Startup folder, it will run automatically when Word opens any document. 

@Jay Freedman you are a LEGEND!

 

I'll have to wait for feedback from users but I have high hopes that this will counteract a very longstanding issue.  I can't believe it's taken this long for someone to give me what is an incredibly simple and elegant solution.

 

I cannot thank you enough!!

@Jay Freedman Hi Jay, our hidden text has returned!! 

The IT guys opted to add a separate document (HiddenText.dotm) containing the AutoOpen() code into our shared folder which also contains Global.dotm (which houses a whole bunch of building blocks and a customised Word ribbon, etc.) and a couple of other documents.  All users profiles are pointed to here.

 

I thought initially it had worked but a couple of days in I was told someone had had their display setting changed again and hidden text was locked on.

 

I'll be doing some testing with our IT guys later today, but just wondered if you might have any thoughts?  I am devastated that this problem is still ongoing.  Thank you in advance!

Is the folder where HiddenText.dotm is stored designated as the users' STARTUP folder? The point is to make sure that the template gets loaded during Word's startup, even before the first document is opened, so the AutoOpen macro is available when that first document does open.

Out of the box, the STARTUP folder is the one whose path is what I showed in my first response. A different folder can be selected by going to File > Options > Advanced and clicking the Folder Locations button near the bottom of the dialog. It can also be changed by a script that changes a registry entry.

Hi @Jay Freedman

 

Yes that's right.  Apologies that I was unclear - the folder I mentioned is designated as all users' startup folder.  My understanding was that with this setup in place the hidden text setting would be forcibly unchecked every single time a user opens any document throughout the day (i.e. not just unchecked once on startup, with no further action thereafter).  Is that correct? 

 

Our system is a little convoluted so there may be something else going on, but I really thought this would work.

@Kazran 

I suppose it's possible that the Lexis system is changing the option (or its corresponding registry entry) after the AutoOpen macro runs. I would find that unusual, maybe even perverse, but there's nothing to prevent it.

 

Does the macro I showed in my first reply not turn it off?

Hi@Jay Freedman 

 

I've done some more looking around online and it seems that in fact AutoOpen does need to be added specifically to Normal.dotm (and hopefully in our case it will work by adding it to our shared Global.dotm which all our user profiles are based on). 

 

According to the below article (and a couple of others I found), it actually won't work if it's placed in another .dotm in the startup folder.  I'll be fixing this up tonight and we'll see how it goes!

 

wordmvp.com/FAQs/MacrosVBA/DocumentEvents.htm

 

 

 

@Kazran 

You're correct about AutoOpen needing to be in Normal.dotm instead of in an add-in. I had forgotten that fact -- the article you cited is about 15 years old but still applicable. 

 

If the documents are based on Global.dotm, and the AutoOpen macro is also in the same template, then it should work.

1 best response

Accepted Solutions
best response confirmed by Kazran (Copper Contributor)
Solution

@Kazran 

You can install the following macro in each user's Normal.dotm template (or another .dotm template stored in the folder %appdata%\Microsoft\Word\STARTUP), and assign a shortcut and/or Quick Access Toolbar button to run it:

 

Sub HideHiddenText()
     ActiveWindow.View.ShowHiddenText = False
End Sub

 

If the documents open with hidden text showing, you can make a copy of the same macro with "HideHiddenText" replaced by "AutoOpen", which will automatically execute each time a document is opened.

View solution in original post