To update a selection in the drafts folder
Option Explicit
Public Sub AddSignature()
'Graham Mayor - https://www.gmayor.com - Last updated - 12 Apr 2021
Dim FSO As Object, oSig As Object
Dim olItem As MailItem
Dim strPath As String
Dim strSignature As String
Const strSig As String = "Graham Mayor.htm" 'the signature to add - change as required
If Application.ActiveExplorer.Selection.Count = 0 Then
MsgBox "No Items selected!", vbCritical, "Error"
Exit Sub
End If
strPath = Environ("appdata") & "\Microsoft\Signatures\"
Set FSO = CreateObject("Scripting.FileSystemObject")
Set oSig = FSO.OpenTextFile(strPath & strSig)
strSignature = oSig.ReadAll
oSig.Close
For Each olItem In Application.ActiveExplorer.Selection
If olItem.Parent = "Drafts" Then
If TypeName(olItem) = "MailItem" Then
With olItem
.BodyFormat = olFormatHTML
.HTMLBody = .HTMLBody & strSignature
.Save
End With
End If
End If
Next olItem
lbl_Exit:
Set FSO = Nothing
Set olItem = Nothing
Set oSig = Nothing
Exit Sub
End Sub