VBA: False Macro Warning in Word 97

  • This is a long post, but pretty simple, really. It's the problem itself that's annoying and frustrating.

    I'm getting 'Macro Virus Warning' messages from Word when I KNOW that there is no macro or module contained in the file. (I can create a .doc file that causes the Macro Virus Warning to display upon opening the file, but I can't figure out how to take that out again. In other words, I don't know 'how' I am doing this.) I prefer to keep the 'Warning' option turned on, because I do open docs from colleagues, and I do want to know when macros may be included.
    Here is what I have done to create a .doc file that displays the warning message (done in Word):

    Type a new document:

    "This is a test document to demonstrate ‘false’ macro warnings. It is first created by ‘File / New / Blank Document’, this text is typed, and it is saved as ‘TEST.DOC’." (Then do all of that.)

    Since there is no macro code at all, and nothing has been done to spoof a macro, the file can be saved and re-opened at will with no problems. (Tools / Options / General / ‘Macro Virus Protection’ is ‘ON’ and should remain 'ON')

    Now run VBA (Alt-F11) and view the Code window if it isn’t already opened. Before doing any more to the document, go back to the Word document and save it again (to assure that simply opening VBA hasn’t corrupted it).

    Re-open the document and re-run VBA to see the Code window again. In the Code window click the top left drop-down (‘(General)’ by default) to get the ‘Document’ region. This enters tags for ‘Private Sub Document_New ()’ and ‘End Sub’, but no actual code.

    If anything is entered between those tags and saved (even as little as a space character), then Word seems to recognize that 'a macro exists'. When the document is then saved and retrieved the macro warning is activated. Fair enough. But trying to delete the macro that has been so created has not been successful. There seems to be nothing I can do any more to wipe out the false ‘macro’ and avoid the warning dialog on opening the file.

    How can this entire process be reversed to completely eliminate the phantom ‘macro’ that is created?


  • Hi Chris,

    Just some toughts (without any testing of Your suggestion)...

    Even if there is no code but there exist a VBA-module the warningsmessage will pop up.

    So the only modules that should be available is the "ThisDocument"-module and a reference to the normal.dot.

    Another thing is that we can accidently record a macro that is saved in normal.dot which trigger the warningmessage as well.

    Usually I find Word to be more difficult to work with compared with Excel where some of the difficulties are explained above.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!