Apr 07 2020 08:42 PM
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!
Apr 10 2020 06:56 PM
SolutionYou 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.
Apr 16 2020 05:19 PM
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.
Apr 19 2020 06:30 PM
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.
Apr 21 2020 05:45 PM
@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!!
Apr 27 2020 03:28 PM
@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!
Apr 27 2020 06:26 PM
Apr 27 2020 08:01 PM
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.
Apr 28 2020 10:13 AM
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?
May 04 2020 11:41 PM
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
May 05 2020 04:30 PM
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.
Apr 10 2020 06:56 PM
SolutionYou 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.