title: How to add VBA Signature on Email with HTMLBody?
body: <p>I got the following from <a href="https://stackoverflow.com/questions/8994116/how-to-add-default-signature-in-outlook">How to add default signature in Outlook</a>. However, I keep getting an error "Application-defined or object-defined error" where the signature variable is set. How can I fix this error?</p>
  
  <pre><code>Dim OApp As Object, OMail As Object, signature As String
  Set OApp = CreateObject("Outlook.Application")
  Set OMail = OApp.CreateItem(0)
  With OMail
      .Display
  End With
  signature = OMail.body
  With OMail
      '.To = "someone@somedomain.com"
      '.Subject = "Type your email subject here"
      '.Attachments.Add
      .body = "Add body text here" &amp; vbNewLine &amp; signature
      '.Send
  End With
  Set OMail = Nothing
  Set OApp = Nothing
  </code></pre>
  
  <p>I know I could get the signature from the C:\Users...\Signatures\ folder. However at work, we all use virtual desktops and the permissions there are a tad janky.</p>