dim DocP$ DocP$="C\~$Doc1.docx" If Dir(DocP, vbHidden) = "" Then MsgBox "未打开" Else MsgBox "已打开" End If路径自己修改