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
執行完後還是獨佔住

全站熱搜

vbqa 發表在 痞客邦 留言(1) 人氣()