Word document created with dot file not opening in MS Word 2019

Dear Support Team,

We have created word document from dot template file dynamically using Syncfusion and c#. The document created is opening in all versions of Microsoft Word except for 2019. This problem occurs for the dot files with two tables. We have attached sample code with this mail, please give us a solution.

The sample code will create a word document (table.doc) from (orders1.dot) file. You can find the table.doc file in the bin folder. Orders1.dot file will be in Testword folder.

ERROR while opening in word 2019: Word was unable to read this document. It  may be corrupt. Try one or more of the following: *Open or Repair the file. *Open the file with text recovery convertor.

Thanks,

Chetra

Attachment: Testword_8e4b9bcb.zip

4 Replies 1 reply marked as answer

HC Hemalatha Chiranjeevulu Syncfusion Team December 15, 2020 10:48 AM UTC

Hi Murali,

Thank you for contacting Syncfusion support.

We have tried to reproduce the reported problem using the given sample application, but it works properly at our end. We run the given sample application and open the output document from bin folder in Microsoft Word 2019, but it opens properly. Please refer the below screenshot of the same:
 
 

Please refer the screenshot of Microsoft Word application, which we checked.

 
 

We suspect that the problem might be due to Microsoft Word application build version. Could you please share the screenshot of complete version of Microsoft Word application (issue occurring version) which installed at your end. Please refer here to find the version details of Word application.

Please let us know if you have any other questions.

Regards,
Mohanaselvam J
 



CP CPS December 15, 2020 12:16 PM UTC

Dear Support Team,

Thanks for your immediate response. 

We are using Microsoft Word 2019 MSO (16.0.13127.20566) 64 Bit. For this version, the file is not opening correctly.  We have also attached the build version screen shot. Please do the needful.

Thanks,
Chetra

Attachment: WordVersion_2ffc4fcd.7z


MJ Mohanaselvam Jothi Syncfusion Team December 17, 2020 11:59 AM UTC

Hi Murali,

Thank you for sharing us the details.

We can reproduce the reported issue when opening the DocIO saved DOC format document in specific Microsoft Word application from our side and suspect it to be a defect. We will validate on this issue and update you the further details on 21st December, 2020.

Please let us know if you have any other questions.

Regards,
Mohanaselvam J 



HC Hemalatha Chiranjeevulu Syncfusion Team December 21, 2020 03:57 PM UTC

Hi Murali,

Thank you for your patience.

On further checking the reported problem, we have found that you are inserting bookmark start and end improperly in the sample application. If you wish to insert content in bookmark range, we recommend you to set start and end first (which denotes the range) and then insert contents. Please find the below highlighted code snippet and use the same in your same application to resolve the reported issue.
 
paragraph.AppendText("   "); 
paragraph.AppendBookmarkStart("tableS" + elementName); 
paragraph.AppendBookmarkEnd("tableS" + elementName); 
var bk = new BookmarksNavigator(document); 
bk.MoveToBookmark("tableS" + elementName); 
bk.InsertTable(tbl); 
bk = null; 
tbl = null; 
  

In the given sample, table is inserted before setting valid range (start and end) for bookmark. So, in the file level it writes improperly which rises corruption problem in Word application. In other Word application version, when opening the Word document it may autocorrects the file level information to open properly in Viewer. So, we have faced problem in particular version.

Please let us know if you have any other questions.

Regards,
Hemalatha C
 


Marked as answer
Loader.
Up arrow icon