Dim docOld As NotesDocument Dim docNew As NotesDocument Forall itemTemp In docOld.Items If itemTemp.name <>"$FILE"Then Call itemTemp.remove EndIf End Forall Call docOld.CopyAllItems(docNew,False) Call docNew.Save(False,False)
思路: 首先创建一个临时文档(docOld),把所有域的内容删除,只保留附件的内容,然后把该文档的所有内容拷贝到目标文档(docNew),参考代码:Dim docOld As NotesDocumentDim docNew As NotesDocumentForall itemTemp In docOld.Items If itemTemp.name "$FIL