Find Corrupted word document

V

VIJAY KUMAR

Hi,

I am working on the Word automation and every time i am opening and
closing word document. if there is any Corrupted document its opening a
dialog box saying that this document is corrupt anad want to repiar?

is there any way to force dont show the dialog box and just repair the
document with out promting the dilaog box. I already the OpenandRepair
paramete as True but still it poping the dialogbox

this is how i am passing parameters

objDoc = wordApp.Documents.Open(ref Source, ref missing, ref missing, ref
falseObject, ref missing,
ref missing, ref trueObject, ref missing, ref
missing, ref missing, ref missing,
ref falseObject, ref trueObject, ref missing, ref
missing, ref missing);

Any help would be appriciated.

Thanks
Vijay
 
P

Pranav Vaidya

Hi Vijay,

There are couple of ways in which you can achieve this.

You can remove the autorevover files option from Tools-Options
Remove Allow Background Saves.

Otherways is little longer.
Remember, everytime a Word file is closed abnormally, word automatically
creates a temp file for that document. such a file is usually stored along
with the original document. Such file name starts with '~'. You can delete
all such file entries before you open any document which will not show the
File-repair window.

However, doing so involves risk of data loss.

Hopet his helps.

Pranav Vaidya
 
V

VIJAY KUMAR

Hi Vaidya,

Thank you very much for your quick response. I can' go for the first
option, because we can not say to end users to turn off that feature. Second
option is not a good idea but it works.

Thanks
Vijay
 
G

George Lee

Those options aren't bad but they're not applicable in my scenario. In part,
we get files from many users and different sites, so I can't always see the
temp file.

Is there a way to tell if the file has these errors and then just save the
document? Can the dialog be suppressed.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top