Fast and easy to use cross-platform .NET library that creates or modifies Microsoft Word (DocX) and later also Excel (XLSX) files without installing any software. Library is based on Open XML SDK
MIT License
279
stars
49
forks
source link
Reading distributed/interrupted instructions of field codes causes an exception #94
The instruction text will be concatenated to form the string XE "Introduction"
Actual Behaviour
An Exception will be thrown, because the detected fieldCode is just XE ":
Unhandled exception. System.NotImplementedException: The missing part """ of the field code "XE "" couldn't be processed by the Parser
at OfficeIMO.Word.WordFieldParser.ParseFieldCodeDeclaration(String fieldCodeDeclaration) in /home/f/OfficeIMO/OfficeIMO.Word/WordFieldParser.cs:line 118
at OfficeIMO.Word.WordFieldParser..ctor(String fieldCodeDeclaration) in /home/f/OfficeIMO/OfficeIMO.Word/WordFieldParser.cs:line 56
at OfficeIMO.Word.WordField.get_FieldType() in /home/f/OfficeIMO/OfficeIMO.Word/WordField.cs:line 107
Possible Fix Suggestions
Improve the reading/parsing of the document regarding field codes
Replace the exception with an Console Warning and work with incorrectly read/parsed document
I just stumbled upon an issue. Given this markup from a off-the-shelf Word document:
From the document:
Expected Behaviour
The instruction text will be concatenated to form the string
XE "Introduction"
Actual Behaviour
An Exception will be thrown, because the detected fieldCode is just
XE "
:Possible Fix Suggestions