Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to suppress repair warnings dialogs and open word documents using interop.word package in net?

In my ASP.NET windows application, i have to manipulate Word 2007 document.So, i am using Microsoft.Interop.Word package for that work.For normal document it is working correctly...

At the same i have to open some type of corrupted file also.for example,header/footer losses,alignment losses...

So, i was opened files like that below...

wordDocument = wordApplication.Documents.Open(ref paramSourceDocPath, OpenAndRepair:true);

So, Now it is working fine with above mentioned case except header/footer lose case.

When i open the document it displays this below mentioned dialog box for confirmation.So, I have to pass this dialog without showing for user confirmation...

enter image description here

After clicking the close button in the dialog box then the document opened correctly...

So,Please guide me to get out of this issue...

like image 337
Saravanan Avatar asked Dec 03 '12 11:12

Saravanan


1 Answers

If you want to suppress this Show Repairs dialog, you can use the Documents.OpenNoRepairDialog method to open your word document instead.

like image 57
MMarriott Avatar answered Nov 14 '22 23:11

MMarriott