WD2000: Macro Virus Warning Appears When No Macros Exist in File

ID: Q238851


The information in this article applies to:


SYMPTOMS

When you open a Microsoft Word 2000 document or template, you may get the following macro virus warning even though the document or template does not contain macros:

C:\<path>\<filename> contains macros.

Macros may contain viruses. It is always safe to disable macros, but if the macros are legitimate, you might lose some functionality.


CAUSE

When you delete macros from a document or template, some macro storage components are left behind. The macro virus protection feature finds this information, and the warning message may be displayed.


WORKAROUND

Use one of the following methods appropriate for your situation to work around this problem:

Method 1: Delete the Remaining Macro Storage Component

Microsoft provides programming examples for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability and/or fitness for a particular purpose. This article assumes that you are familiar with the programming language being demonstrated and the tools used to create and debug procedures. Microsoft support professionals can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific needs. If you have limited programming experience, you may want to contact a Microsoft Certified Solution Provider or the Microsoft fee-based consulting line at (800) 936-5200. For more information about Microsoft Certified Solution Providers, please see the following page on the World Wide Web:

http://www.microsoft.com/mcsp/
For more information about the support options available from Microsoft, please see the following page on the World Wide Web:

http://www.microsoft.com/support/supportnet/overview/overview.asp
Macros that are contained in your Word document or template are saved in a module. After you delete macros from a document or template, the module that contained the macros remains and is not removed when the macros are deleted.

To delete the module from your Word document or template and prevent the macro virus warning from appearing, do the following steps:

NOTE: Removing a module deletes the macros that it contains.
  1. Open the document or template that gives the macro virus warning.


  2. On the Tools menu, point to Macro and click Visual Basic Editor.


  3. In the Project window, expand the document (template) project. The document (template) project should look similar to the following example:
    Project (<filename>)
    NOTE: If the Project window is not visible, click Project Explorer on the View menu. To expand the document (template) project, click the plus sign to the left of the Project (<filename>).


  4. Expand the Modules folder.


  5. Click to select the module. For example, click to select NewMacros.

    NOTE: The name of the module listed may be different in your document (template) project. For example, it may be named Module1 or some different name.


  6. On the File menu, click Remove <ModuleName>. Click No to the following message:
    Do you want to export <ModuleName> before removing it?
    NOTE: If you are uncertain whether the module you are removing contains macros, click Yes and export the module as a Basics Files (*.bas).


  7. Repeat steps 5-6 for each module listed under the Project (<filename>) Modules folder.


  8. On the File menu, click Close and return to Microsoft Word.


  9. Save and close the Word document (template).


The macro virus warning no longer appears when you open the document (template).

Method 2: Copy the Template to a New Word File

NOTE: Use this procedure when your Word template contains no macros but displays the macro virus warning as described in the "Symptoms" section of this article when you open it or try to create a new document based on it (on the File menu, click New). Create a new template using the following steps:

NOTE: After the new template is created, you can copy all custom styles, AutoText entries, and so forth to the new template, but do not copy any macros to the new template.
  1. On the File menu, click Close to close the file that displays the macro virus warning.


  2. On the File menu, click New.


  3. On the General tab, click to select Blank Document and click OK.


  4. On the Insert menu, click File.


  5. In the Insert File dialog box, change the Files of type box to Document Templates (*.dot).


  6. Change the Look in box to the folder that contains the problem template. For example, change the Look in box to the following folder:
    C:\WINDOWS\Application Data\Microsoft\Templates
    NOTE: Your template may be found in a different folder.


  7. Click to select the problem template, and then click Insert.


  8. On the File menu, click Save As.


  9. In the Save As dialog box, change the Save as type box to Document Template (*.dot).


  10. In the File name box, type a file name for your new template and then click Save.


  11. On the File menu, click Close to close your new template.


Any macros or remaining macro storage components from your problem template are not saved to the new template, and the macro virus warning no longer appears when you open the template or use it to create a new document (on the File menu, click New).

Method 3: Save the Word Document as Rich Text Format (RTF)

NOTE: Use this procedure when your Word document contains no macros but displays the macro virus warning as described in the "Symptoms" section of this article.
  1. Open the document that gives the macro virus warning.


  2. On the File menu, click Save As.


  3. In the Save As dialog box, under Save as type, click Rich Text Format (*.rtf), and then click Save. Click Yes to the following message:


  4. All macros in this document will be lost if the document is saved in Rich Text Format. Do you want to save in this format anyway?
  5. On the File menu, click Close to close the Rich Text Format document you just saved.


  6. On the File menu, click Open and open the Rich Text Format document you saved in step 3.


  7. On the File menu, click Save As.


  8. In the Save As dialog box, under Save as type, click Word Document (*.doc), and then click Save. If you are saving the file back to its original file name, click Yes to the following message:


  9. The file <filename> already exists. Do you want to replace the existing file?
  10. Close and reopen the document.


Any macros or remaining macro storage components are not saved to the new document, and the macro virus warning no longer appears when you open the document.


STATUS

Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article.


MORE INFORMATION

Macro storage components are not present in a Word document or template until you store a macro in the file. These components exist as supporting structures for the existence and storage of macros in a file. When you delete all of the macros in a file, the macro storage components are not removed. The macro virus warning feature of Microsoft Word 2000 detects the macro storage components in the file and presents the macro virus warning when you open the file.

To remove macros from a Word document, do the following:

  1. Open the file in Word.


  2. On the Tools menu, point to Macro, and then click Macros.


  3. In the Macros dialog box, select a macro name and then click Delete. This removes the macro from the file.


  4. Repeat step 3 for each of the macros you want to remove.


For additional information, click the article number below to view the article in the Microsoft Knowledge Base:
Q233396 WD2000: How to Reduce the Chances of Macro Virus Infection

Additional query words: vba


Keywords          : kbdta wd2000 
Version           : WINDOWS:2000
Platform          : WINDOWS 
Issue type        : kbbug 

Last Reviewed: August 12, 1999