更新时间:2023-11-22 07:59:10
您有两个不合格的Word对象引用:
You have two unqualified references to Word objects:
objSelection.Style = ActiveDocument.Styles("Heading 1")
出现两次,需要:
objSelection.Style = objWord.ActiveDocument.Styles("Heading 1")
否则,您将创建一个不能销毁的Word的隐式引用你的代码。
Otherwise you're creating an implicit reference to Word that you can't destroy in your code.