Unplanned
Last Updated: 01 Aug 2024 06:19 by George
George
Created on: 01 Aug 2024 06:19
Category: WordsProcessing
Type: Bug Report
0
WordsProcessing: DocxFormatProvider: XmlException is thrown when importing documents containing DAT files.

XmlException is thrown when importing documents containing DAT files.

Workaround

1) Delete the files from the file structure before import:

RadFlowDocument flowDocument; using (Stream str = new FileStream("input.docx", FileMode.OpenOrCreate)) { MemoryStream ms = new MemoryStream(); str.CopyTo(ms); ms.Seek(0, SeekOrigin.Begin); using (ZipArchive archive = ZipArchive.Update(ms, null)) { var zipEntries = archive.Entries; // Skip glossary on importfor (int i = zipEntries.Count() - 1; i >= 0; i--) { var entry = zipEntries.ElementAt(i); string entryName = entry.FullName; if (Regex.IsMatch(entryName, @"\[trash\]")) { entry.Delete(); } } }

}

2) Re-save the document with Word before import. At least one change (that can then be reverted) is required. 
0 comments