none
Word Error RRS feed

  • Question

  • I have a program that automatically opens a Word document, it has been running for a number of years but is now crashing at line 3 of the following code. The program closes without error and leaves Word partly open. The word file it is opening opens ok direct from Word. What can I try to resolve this? Thanks in advance, Steve

     Set wrdApp = New Word.Application
     wrdApp.Visible = True
     wrdApp.Documents.Open ("c:\My Documents\Quote-Automatic2.doc")

    • Moved by Cindy Meister MVPModerator Friday, February 3, 2012 7:07 AM not using VSTO technology (From:Visual Studio Tools for Office)
    Friday, February 3, 2012 3:11 AM

Answers

  • Hi Steve

    this is VB 6 ("classic")?

    One thing I'd test is to create a document with a short name (the old 8.3 DOS standard) and put it in a folder with a short name - don't use any spaces or punctuation anywhere. Something like C:\Test\test.doc

    What you describe reminds me of the old error we'd get with long file names if something busted the Registry, except if it were that you should be seeing the error when opening the file manually.

    Does this document contain anything except text? Mail merge link? Macros? OLE objects (such as an embedded Excel chart)?


    Cindy Meister, VSTO/Word MVP
    • Proposed as answer by Bruce Song Friday, February 10, 2012 9:13 AM
    • Marked as answer by Bruce Song Thursday, February 23, 2012 9:16 AM
    Saturday, February 4, 2012 8:49 AM
    Moderator

All replies

  • Hello,

     

    Try to find what is the error using the Window Log. There an application error could be found. Also, have you tried openning the document from Windows?

     

    Best regards,

    Silviu.


    http://www.rosoftlab.net/
    Friday, February 3, 2012 8:27 AM
  • That's an unusual path for the "My Documents" folder ... a least it's unusual for the standard setting of where the personal directory normally is located.  What operating system are you using and what version of Word?

    Have you verified the location of that file?


    Kind Regards, Rich ... http://greatcirclelearning.com
    Friday, February 3, 2012 10:37 AM
  • Hi Steve

    In addtion to Rich's questions, I'd also like to know what you mean by "leaves Word partly open"?

    And from within what application are you running this?


    Cindy Meister, VSTO/Word MVP
    Friday, February 3, 2012 3:22 PM
    Moderator
  • Thanks for the replies to my question.

    Event log says Event ID 1000. The document opens fine if I open it manually from Word. I just use that folder to keep it seperate from other files. Windows XP, Word 97. Word is open but there is no file loaded.

    The funny thing is I can run the program from inside VB without error, but as soon as I compile the program and run it from the stand alone exe it errors?

    The only thing I can think of is a new automatic Windows security update blocking the program accessing Word remotely?

    Thanks, Steve

    Friday, February 3, 2012 9:27 PM
  • Hi Steve

    this is VB 6 ("classic")?

    One thing I'd test is to create a document with a short name (the old 8.3 DOS standard) and put it in a folder with a short name - don't use any spaces or punctuation anywhere. Something like C:\Test\test.doc

    What you describe reminds me of the old error we'd get with long file names if something busted the Registry, except if it were that you should be seeing the error when opening the file manually.

    Does this document contain anything except text? Mail merge link? Macros? OLE objects (such as an embedded Excel chart)?


    Cindy Meister, VSTO/Word MVP
    • Proposed as answer by Bruce Song Friday, February 10, 2012 9:13 AM
    • Marked as answer by Bruce Song Thursday, February 23, 2012 9:16 AM
    Saturday, February 4, 2012 8:49 AM
    Moderator