为什么"Error 6124: You are not allowed to edit this section because it is protected."
在某些机器上运行此代码时会收到错误消息?我没有在我的开发机器上得到它。书签与表单域相关联。
Set objWordApp = CreateObject("Word.Application")
Set oDoc = objWordApp.Documents.Open(strDocPath)
oDoc.bookmarks("CustomerName").Select
objWordApp.selection = "Mr Smith"
oDoc.bookmarks("CustomerNumber").Select
objWordApp.selection = "0001"
oDoc.save
oDoc.Bookmarks("Comments").Select
oDoc.ActiveWindow.View = 1
objWordApp.WindowState = 0
objWordApp.Visible = True
oDoc.Activate
objWordApp.Activate