Document.WordOpenXML Property throws System.OutOfMemoryException RRS feed

  • Question

  • Hi,

    We have a developed an word add-in (C#) which fetches the complete WordOpenXML from the document.

    This API fails on 32bit Word and throws System.OutOfMemoryException.

    The document is only one page

    I have attached a link for the document

    Exception of type 'System.OutOfMemoryException' was thrown.
       at System.String.CtorCharPtrStartLength(Char* ptr, Int32 startIndex, Int32 length)
       at System.StubHelpers.BSTRMarshaler.ConvertToManaged(IntPtr bstr)
       at Microsoft.Office.Interop.Word.DocumentClass.get_WordOpenXML()

    Sadly there is no option to upgrade to 64 bit system.
    Does anyone know a workaround or a solution to get WordOpenXML by any other way?


    Thursday, February 21, 2019 8:43 AM