开发者

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

开发者 https://www.devze.com 2022-12-25 09:06 出处:网络
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 th

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

精彩评论

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