FIX: Word 2000 Remains in Memory After Automation Client Shuts Down (250977)



The information in this article applies to:

  • Microsoft Word 2000

This article was previously published under Q250977

SYMPTOMS

When a Word 2000 document containing a table is embedded in an ActiveX Document Container, such as the Web Browser Control or Microsoft Office Binder, and automation code references a Row object in that table, Word remains in memory even after the container application shuts down.

This problem is specific to Word 2000 and is demonstrated by all container applications that embed Word 2000.

RESOLUTION

Download and install Service Release 1 for Office 2000 at the following location:

STATUS

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

The problem has been corrected in Service Release 1 for Office 2000.

MORE INFORMATION

The sections below illustrate how to reproduce the problem by using Automation to Microsoft Office Binder or by using the Web Browser Control to host a Word Document.

NOTE: Before proceeding with the steps below, create a new Word 2000 document that contains a table and then save the document as C:\Doc1.doc. Create a new Visual Basic Standard EXE project, and add a CommandButton control to Form1.

Steps to Reproduce Behavior by Using Automation to Binder

  1. In the code window for Form1, add the following code:
    Private Sub Command1_Click()
        Dim oBdr As Object
        Dim oWdSec As Object
        Dim oRow As Object
        
     ' Create Binder App. If Binder is not installed,
     ' you'll get an error here...
        Set oBdr = CreateObject("Office.Binder")
        
     ' Make Binder visible...
        oBdr.Visible = True
    
     ' Add Doc1 as a new section to the binder...
        Set oWdSec = oBdr.Sections.Add(, "C:\Doc1.doc")
    
     ' Reference a row in the table
        Set oRow = oWdSec.Object.Tables(1).rows(1)
    
     ' Release the reference to the Row
        Set oRow = Nothing
    
    End Sub
    					
  2. Press the F5 key to run the Visual Basic application.
  3. Click the CommandButton to Automate Binder and insert the Word document. When the Word document is visible, highlight the table and press the SHIFT+DELETE key combination to delete it (or, from the Table menu, choose Delete, and then choose Table).
  4. Shut down the Visual Basic application and close Binder. WINWORD.EXE stays in the task list even though the host application has shut down.

Steps to Reproduce Behavior by Using Web Browser Control

  1. From the Project menu, select Components, add a reference to the Microsoft Internet Controls, and then click OK.
  2. Select a WebBrowser control from the toolbox and add the control to Form1. Then, in the code window for Form1, add the following:
    Dim oDoc As Object
    
    Private Sub Command1_Click()
        'Navigate to a Word document 
        WebBrowser1.Navigate2 "c:\doc1.doc" 'Where doc1.doc has a table
    End Sub
    
    Private Sub Form_Unload(Cancel As Integer)
        'Clean up the global object reference
        Set oDoc = Nothing
    End Sub
    
    Private Sub WebBrowser1_NavigateComplete2(ByVal pDisp As Object, _
      URL As Variant)
        On Error Resume Next
        Dim oRow As Object
    
        'Set a reference to a Row in the table
        Set oDoc = pDisp.Document
        Set oRow = oDoc.Tables(1).rows(1)
    
        'Release the Row reference
        Set oRow = Nothing
    End Sub
    					
  3. Press F5 to run the Visual Basic application.
  4. Click the CommandButton to load Doc1.doc into the WebBrowser control. When the Word document is visible, highlight the table and press SHIFT+DELETE to delete the entire table.
  5. Shut down the Visual Basic application. WINWORD.EXE stays in the task list even though the host application has shut down. To avoid the problem, do not set a reference to a Row object for a Word table that is likely to be deleted. You can also avoid the problem by upgrading the client to Word 2000 Service Release 1.

REFERENCES

For additional information about this problem, click the article number below to view the article in the Microsoft Knowledge Base:

243806 BUG: MFC ActiveX Document Container Hangs After Deleting a Table in an Word 2000 Document


Modification Type:MinorLast Reviewed:8/9/2004
Keywords:kbdownload kbActiveDocs kbAutomation kbbug kbfix KB250977