1

The following code:

Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
  Dim sName As String
  Dim otlQuote As Outlook.MailItem

  If InStr(Item.Subject, "SOQ") <> 0 Then
    sName = Item.Body
    Set otlQuote = Application.CreateItemFromTemplate(Environ("AppData") & "\Microsoft\Templates\Outlook Templates\Quotations.oft")
    Item.HTMLBody = otlQuote.HTMLBody
    Item.HTMLBody = Replace(Item.HTMLBody, "Good day ", "Good day " & sName)
  End If
End Sub

Produces images that look like this:

FailedImage

I know why this is happening, it’s because the image is linked and not embedded into the file, but is there any way to resolve this?

Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343

1 Answers1

0

You are only copying the message body, but not the attachments (which probably contain the images).

Dmitry Streblechenko
  • 62,942
  • 4
  • 53
  • 78