Dim wd As New Word.Application
Dim ww As Document
Set ww = wd.Documents.Open("c:\Word.Doc")
wd.ActiveDocument.Protect Password:="pass", NoReset:=False, Type:=wdAllowOnlyFormFields
'離開Word且存檔
wd.Quit savechanges:=True
Set ww = Nothing
Set wd = Nothing
執行完後還是獨佔住
Dim ww As Document
Set ww = wd.Documents.Open("c:\Word.Doc")
wd.ActiveDocument.Protect Password:="pass", NoReset:=False, Type:=wdAllowOnlyFormFields
'離開Word且存檔
wd.Quit savechanges:=True
Set ww = Nothing
Set wd = Nothing
執行完後還是獨佔住
請先 登入 以發表留言。