Results 1 to 5 of 5
  1. #1
    2 Star Lounger
    Join Date
    May 2002
    Location
    Houston, Texas, USA
    Posts
    100
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Document opens, automatically closes (2000)

    We have received a document from a client. When we open the document, it flashes on the screen for less than a second, then automatically closes on its own. No matter what machine we use, the same thing happens. We did an Insert, File into a blank document that remained open. Oddly, however, all text insert showed up in track changes mode even though that feature was not on. We accepted changes and the document appears fine, minus alot of the formatting that appeared in the original.

    What would be causing the original document not to remain open for longer than a second? Would this be some sort of macro, or simply a corrupt document?

    **Just attempted to open the document again and got the following in VBA:

    Sub AutoOpen()


    ' CrossWords Start AutoOpen
    Dim iCount As Integer
    iCount = Documents.Count
    If ActiveDocument.ProtectionType = wdNoProtection Then
    AddIns.Add Application.Options.DefaultFilePath(wdStartupPath) & "CrossWds.DOT", True
    Application.Run "CrossWords"
    End If
    If Documents.Count < iCount Then Exit Sub
    ' CrossWords End AutoOpen


    End Sub

    Help!

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Document opens, automatically closes (2000)

    What happens if you hold the Shift key down while you open the document? This prevents automatic macros from running.

  3. #3
    2 Star Lounger
    Join Date
    May 2002
    Location
    Houston, Texas, USA
    Posts
    100
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Document opens, automatically closes (2000)

    I tried that and the document does open. What would be the cause for that? Also, when I open the document I get the following message:

    "The table in this document has become corrupted. To recover the contents of the table, select table and Convert Table to Text from the menu."

    There are no tables in the document.

    Is this a VBA issue or a corruption issue?

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Document opens, automatically closes (2000)

    the code you posted in your edit of the original post shows that the document contains a macro that runs automatically when you open the document. This macro tries to install an add-in in Word and run a macro from that add-in. That, together with the warning about a corrupted table, should be enough to send the document back to the client with the request to send a clean version.

    By the way, you apparently didn't get a macro warning when you first tried to open the document. Is your macro security set to Low (Tools | Macro | Security)? That is a dangerous setting, Medium is recommended.

  5. #5
    2 Star Lounger
    Join Date
    May 2002
    Location
    Houston, Texas, USA
    Posts
    100
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Document opens, automatically closes (2000)

    As always, thanks Hans.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •