none
Word Automation Error RRS feed

  • Question

  • I am trying to control Word 2007 Small Business Edition from Visual FoxPro. I instantiate a Word Object with

    loword=newobject("Word.Application")

    mfile=***some word file***

    loword.Documents.Open(mfile,.f.,.f.,.f.,"","",.f.,"","","wdOpenFormatAuto","")

    loword.visible

    loword.activate

    Everything works until the next statement which is mv=loword.documents[1].protectiontype

    This should retrieve the protection type, but instead I get

    Error number:1426

    Error message: OLE error code 0c800a8029: Unknown COM status code.

    (Addl traceback code follows).

    I tried ActiveDocument in place of documents[1] and got the same result.  Everything else works and the code works fine on Word 2013 (and I think 2010 also).

    I can't find a relevant reference to this error code anywhere. 

    Any help greatly appreciated!

    Tuesday, May 5, 2015 5:08 PM

All replies

  • Hi,

    This is the forum to discuss questions and feedback for Microsoft Word, the issue is more related to Word coding/programing, I'll move your question to the MSDN forum for Word

    http://social.msdn.microsoft.com/Forums/en-US/home?forum=worddev&filter=alltypes&sort=lastpostdesc

    The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us. Thank you for your understanding.

    George Zhao
    TechNet Community Support


    It's recommended to download and install Configuration Analyzer Tool (OffCAT), which is developed by Microsoft Support teams. Once the tool is installed, you can run it at any time to scan for hundreds of known issues in Office programs.

    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact tnmff@microsoft.com.
    Wednesday, May 6, 2015 5:36 AM
  • Hi Steve,

    I am failed to reproduce the issue using VBA in Word 2007. Can you reproduce this issue using code below in VBE window? You can open VBE by pressing Alt & F11.

    Sub Main()
    
    Debug.Print ActiveDocument.ProtectionType
    End Sub

    If this issue could also reproduced, I suggest that you update or repair the Office product to see whether the issue was fixed.

    Hope it is helpful.

    Regards & Fei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, May 8, 2015 2:45 AM
    Moderator
  • Hi Steve

    Can you issue any other commands that work in the document, such as documents[1].context.tExt = "abc", or does that also throw an error? (Note: this will replace all content in the document, so use on a throwaway or don't save.)

    If this also throws an error, then Word may be opening the document in a non-editable mode or it may be displaying a message and waiting for user interaction? Although since you're making the app window visible the latter is less likely...

    Is it possible that the document contains something Word 2007 can't work with? Are you able to open it as a user in 2007 and work with it?


    Cindy Meister, VSTO/Word MVP, my blog

    Tuesday, May 19, 2015 6:11 PM
    Moderator