Personally, I think it is impossible. Otherwise, it would not be too convenient for a macro virus to spread. Such a dangerous thing can be called a bug, and Microsoft must fix it.
As for the supplementary problem, it is essentially the same. Relying on VBA code will not work. Office itself does not seem to have this setting option, so in the final analysis, we still have to rely on more advanced methods
The following is a pure copy
[Share] Let’s talk about macro security level and breakthrough macro settings
Talk about macro security level and breakthrough macro settings If you perform a certain task repeatedly in Microsoft Word, You can use macros to automate this task. A macro is a series of Word commands and instructions that are combined into a single command to automate the execution of a task. This is WORD's definition and purpose of macros. It can be seen that they are a method and approach for operators to efficiently complete designated tasks. As an important means of automation for WORD, there are three ways to form VBA code: recording macros; writing VBA code; and modifying WORD commands. All three methods will be recorded. The recording is different from the commands or codes that come with WORD. It will be recognized as a "macro" before running, and the security setting will become a "firewall" that blocks macro codes or macro viruses. As for the recognition and control of macros, the macro security settings used in OFFICE (this article ignores the statement of digital signatures) include: High: Automatically disable macros and open files. Medium: Prompts the user to enable or disable macros. Low: When security is set to low, all macros are treated the same, regardless of the macro's source or certificate status. When using low security, you receive no prompts or signature verification, and macros are automatically enabled. Only use this setting if you are sure that all macros in the file come from reliable sources. In response to past questions from netizens and my understanding and application of this issue for a period of time, we tried to break through the macro security level and directly let other people's machines run WORD files without going through macro security detection, relying only on WORD itself and VBA code. This is It's hard to succeed, and here's why: You can set this up yourself on your own machine. Before your code can be run on other people's machines, you must first reduce the macro security level of other people's WORD to low. If others know nothing about macros (VBA), then according to the default installation of WORD, the macro security level is medium, and macros will appear. Security warning, after seeing the fear of macro viruses, cancel macros without hesitation; if someone "discolors" about macros, they will hang up macros, and all codes will not be able to jump; if everyone knows about macros , know what is going on, how to edit macros, cancel macros, disable macros, the settings are usually low due to needs, what problems are there, can be seen in the code window, if it is a file containing macros that he thinks is unfamiliar, I will definitely use the SHIFT key to cancel the macro and check the code again to see if there is any problem. Another idea (discussed many times with Iljima Aesculata) is to save the file containing VBA code (macro) as a template, NORMAL.DOT. If you use it yourself, there is absolutely no problem, but if it runs on someone else's machine, , you also need to use someone else's WORD program to open it first, but it still won't pass, unless you artificially overwrite someone else's NORMAL.dot with yours. Moreover, when someone else's WORD cannot run, it can be seen that using WORD code cannot do it. .You can try to do it. In summary, VBA or macros are an important means for WORD program automation for operators. It can serve you very conveniently. If you want to show your results to others At this time, the setting of the security level is a necessary and sufficient condition. If you want to hide something through VBA code, as long as you cancel the macro or disable the macro, everything is useless. The following is the code to modify the macro security level using VBA for your reference: Private Sub Document_Open() On Error Resume Next If System.PrivateProfileString("", "HKEY_CURRENT_USER\Software\Microsoft\Office\10.0\Word\Security", "Level ") <> "" Then System.PrivateProfileString("", "HKEY_CURRENT_USER\Software\Microsoft\Office\10.0\Word\Security", "Level") = 1 Else CommandBars("Tools").Controls("14") .Enabled = False End If End Sub It modifies the macro security level by modifying the registry key value. 1 is low, 2 is medium, and 3 is high.
WORD2002 is 10.0, WORD2000 is 9.0. The above is just my personal experience. Please correct me if there is any inconvenience.
Source: h t t p : / /club.excelhome.net/viewthread.php?tid= 26450
I think it is not feasible to bypass security measures just through VBA macros. You must use more "advanced and dangerous" methods