Microsoft KB Archive/238851

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

Article ID: 238851

Article Last Modified on 6/17/2005

-

APPLIES TO


 * Microsoft Word 2000 Standard Edition

-



This article was previously published under Q238851





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:\ \ 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. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers 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 requirements. 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.  Open the document or template that gives the macro virus warning. On the Tools menu, point to Macro and click Visual Basic Editor. In the Project window, expand the document (template) project. The document (template) project should look similar to the following example:

Project

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 . Expand the Modules folder. 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. 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).</li> Repeat steps 5-6 for each module listed under the Project Modules folder.</li> On the File menu, click Close and return to Microsoft Word.</li> Save and close the Word document (template).</li></ol>

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. <ol> On the File menu, click Close to close the file that displays the macro virus warning.</li> On the File menu, click New.</li> On the General tab, click to select Blank Document and click OK.</li> On the Insert menu, click File.</li> In the Insert File dialog box, change the Files of type box to Document Templates (*.dot).</li> 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.</li> Click to select the problem template, and then click Insert.</li> On the File menu, click Save As.</li> In the Save As dialog box, change the Save as type box to Document Template (*.dot).</li> In the File name box, type a file name for your new template and then click Save.</li> On the File menu, click Close to close your new template.</li></ol>

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. <ol> Open the document that gives the macro virus warning.</li> <li>On the File menu, click Save As.</li> <li>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:

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?

</li> <li>On the File menu, click Close to close the Rich Text Format document you just saved.</li> <li>On the File menu, click Open and open the Rich Text Format document you saved in step 3.</li> <li>On the File menu, click Save As.</li> <li>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:

The file already exists. Do you want to replace the existing file?

</li> <li>Close and reopen the document.</li></ol>

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.

<div class="status_section">

STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.

<div class="moreinformation_section">

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:

233396 WD2000: How to Reduce the Chances of Macro Virus Infection

Additional query words: vba

Keywords: kbbug kbpending KB238851

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.