Skip to content

Instantly share code, notes, and snippets.

@tmplinshi
Created March 12, 2017 06:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tmplinshi/652d241abc86914c2bd817590a771621 to your computer and use it in GitHub Desktop.
Save tmplinshi/652d241abc86914c2bd817590a771621 to your computer and use it in GitHub Desktop.
; 判断 word 文件是否已经打开
IsDocOpened(FileName) {
; 确保 FileName 是完整路径
if !InStr(FileName, ":")
FileName := A_ScriptDir "\" FileName
try {
oWord := ComObjActive("Word.Application")
oWord.Documents(FileName)
return true
}
return false
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment