Dim AppWD As Object
Dim objDoc As Object
Dim objDocProdTP As Object
...
Set AppWD = CreateObject("Word.Application") 'Word als Object starten
AppWD.Visible = True
Set objDocProdTP = AppWD.documents.Open(workPath & "\vorlagen\LFPostTemplate.docx")
Set objDoc = AppWD.documents.Open(workPath & "\vorlagen\LFTemplate2.docx")
...
MsgBox (objDocProdTP.Bookmarks.Count)
...
objDocProdTP.Goto what:=-1, Name:="lblPos"
objDocProdTP.TypeText (wbQuelle.Sheets("Tabelle1").Cells(i, 7))
MsgBox (objDocProdTP.Bookmarks.Count)
返回 19,这是 LFPostTemplate.docx 中的书签总数。但objDocProdTP.TypeText (wbQuelle.Sheets("Tabelle1").Cells(i, 7))
返回 Runtimeerror 428“此对象不支持的方法或属性”(我的错误是德语,所以可以免费翻译)
我想要做的是替换标记为书签的文本
另一点是我想将文本附加到书签中的文本