How can I call document.open and avoid the file-in-use dialog?

I am writing a little simple code to open a Word document, save it in a new format and close the document. However, I ran into problems if the document was left in a locked state and the File In Use dialog box opens.

File in Use Dialog

Now I would be happy to choose option 1 or 3 automatically, but I can not find a way. Ideally, I would have prevented him from showing at all with the parameter of the open method. I use Delphi, but this is not relevant.

    Wordapp.documents.Open(InputFile);
+2
source share
1 answer

open ReadOnly, true, -, .

    Readonly := true;
    Wordapp.documents.Open(FName, false, Readonly);  //3rd parameter is readonly

: http://msdn.microsoft.com/en-us/library/office/ff835182.aspx

+11

All Articles