开发者

Unable to open word file (MSWord 2007) when word automation program is running

In my application i am using word automation to get the text content from the file. It is working fine no issues. But at the instant when word automation is processing, if i open the word file, it is throwing a dialog with message (any file)

"This file is in use by another application or user. (C:\User\xyz开发者_StackOverflow\AppData...\Normal.dotm)".

When I am closing the dialog, it is asking for save the file "normal.dotm"...template file.

This happens only in MSWord 2007 not in MSWord 2003. can any one tell the solution please.


This probably happens because one Word instance has locked Normal.dotm and your instance modifies it and tries to save it.

You can try to set the Saved property of your template to True. Try this: Application.NormalTemplate.Saved := True. Word will now think that changes to Normal.dotm are saved and should not try to save again.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜