Deleting Signature After CreateItemTemplate

不羁岁月 提交于 2020-01-06 01:58:28

问题


I am using the below code that I found for a new template but I want to delete the signature.

I either need code to delete the signature after the below code or a completely new code that opens a new email, clears body then inserts template.

Sub NewTemplate()
Set objMsg = Application.CreateItemFromTemplate("S:\filepath.oft")
Set newItem = Nothing
With objMsg
    .SentOnBehalfOfName = "email@email.com"
    .Display
End With
End Sub

回答1:


Set objDoc = objMsg.GetInspector.WordEditor
If objDoc.Bookmarks.Exists("_MailAutoSig") Then
   set objBkm = objDoc.Bookmarks("_MailAutoSig")
   objBkm.Select
   objDoc.Windows(1).Selection.Delete
End If


来源:https://stackoverflow.com/questions/36467499/deleting-signature-after-createitemtemplate

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!