Stop Word From Disabling Macros - key "HKEY_CLASSES_ROOT\Word.Document.12\shell\Open\command" "C:\Program Files\Microsoft Office\Root\Office16\WINWORD.EXE" /q /n "%1"

BruceMDRLA 5 Reputation points
2024-01-08T19:49:12.2866667+00:00

Hi,

I wrote a macro as part of the normal template to stop Word from opening a document in multi-page view. It works fine but, when I open a document that I created, Word disables the macro.

I have changed the settings in the Trust Center in various ways. I tried allowing all macros (I know, not recommended), I have the file with the macro in a directory that is included in the trusted locations, all to no avail.

One other note is that I modified the registry key "HKEY_CLASSES_ROOT\Word.Document.12\shell\Open\command" to include /q so that it now reads: "C:\Program Files\Microsoft Office\Root\Office16\WINWORD.EXE" /q /n "%1" . I did this to stop Word from automatically maximizing documents that have been minimized. The /q does that but it also seems to be the cause of the macro issue. If I remove the /q flag from the registry key, the macros work fine.

But, I would really like to not have Word automatically maximize a random file and also not have Word automatically display docs in in a two page view. The fact that Word does both of these is really galling and that there is no simple way to stop it is even more galling but, that is a discussion for another day.

Update - I have now realized that the macros work fine if no other Word doc is open or, if there is an open doc, if I open another doc from within Word there is no issue. However, if I have one more open Word docs (minimized) and attempt to open another one by double-clicking on the file name in File Explorer, the one that I am trying to open will have the macro issue described above. Also, the color of the two-letter initials for my name in the upper right corner (which indicates the MS365 account that I am signed into) will have one color if no macro issue and, with respect to files that do have the macro issue, a different color.

Anyway, any help that can be provided is greatly appreciated.

Thanks.

Bruce

Word
Word
A family of Microsoft word processing software products for creating web, email, and print documents.
689 questions
Office Development
Office Development
Office: A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.Development: The process of researching, productizing, and refining new or existing technologies.
3,572 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. - Ryan - 0 Reputation points
    2024-03-11T17:52:30.5533333+00:00

    I did the same thing and that q is messing up with my macros. It never used to do that for windows 7 and 10, but it is doing it now for windows 11. Hope there can be a resolution for this at some point

    0 comments No comments