P
Petrowi
Hi.
The program I'm working on saves the current Word document in WordML format,
modifies the saved data (as an XML document), saves the modified data in temp
XML file, opens that file in Word and copies the contents form the temp
document over the original one:
(Original Doc) -> (SaveAs WordML) -> (Modify WordML) -> (Save Temp WordML)
-> (Open Temp WordML in Word) -> (Copy Temp contents over Original contents).
I use this process to speed up otherwise slow operations in Word.
The documents involved have custom Schema and XML markup themselves.
The problem comes when I do this (C#):
wdDocument.Content.FormattedText = tempWdDoc.Content.FormattedText;
The line above throws an exception:
System.Runtime.InteropServices.COMException (0x800A17EA): This action is
not valid outside of a block-level XML element.
at Microsoft.Office.Interop.Word.Range.set_FormattedText(Range prop)
It seems only some machines have this problem.
Does anyone have a clue what this message is?
Thank you.
The program I'm working on saves the current Word document in WordML format,
modifies the saved data (as an XML document), saves the modified data in temp
XML file, opens that file in Word and copies the contents form the temp
document over the original one:
(Original Doc) -> (SaveAs WordML) -> (Modify WordML) -> (Save Temp WordML)
-> (Open Temp WordML in Word) -> (Copy Temp contents over Original contents).
I use this process to speed up otherwise slow operations in Word.
The documents involved have custom Schema and XML markup themselves.
The problem comes when I do this (C#):
wdDocument.Content.FormattedText = tempWdDoc.Content.FormattedText;
The line above throws an exception:
System.Runtime.InteropServices.COMException (0x800A17EA): This action is
not valid outside of a block-level XML element.
at Microsoft.Office.Interop.Word.Range.set_FormattedText(Range prop)
It seems only some machines have this problem.
Does anyone have a clue what this message is?
Thank you.