[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 281
  • Last Modified:

Can't attach a document to a rich text document

See code below. I send a word document to outlook, but if I specify a rich text body format, I can't attach a file. Anyone come across this one? TY.
Dim objEnv As Office.MsoEnvelope
    Dim objMailItem As Outlook.MailItem
    Set objEnv = ActiveDocument.MailEnvelope
    Set objMailItem = objEnv.Item
    With objMailItem
        '.BodyFormat = olFormatRichText
        .To = "james.wagman@test.com"
        .Subject = "a test from Word"
        .Attachments.Add "C:\test2.doc", olByValue, 1, "Test2.doc"
        .BodyFormat = olFormatRichText
    End With
    Set objEnv = Nothing
    Set objMailItem = Nothing

Open in new window

  • 2
1 Solution
Hello jwagman,

In Rich Text format, attachment as show in body of email.  If you want attachment to stay as attachment, send in HTML or Plain Text format.

Hope this helps!
jwagmanAuthor Commented:
There is no way, in code, to send a rich text message with an attachment? Even though I can do it manually? Even using a different method than what I used above??
jwagmanAuthor Commented:
Let me make sure I understand - there is no way by code to send an attachment with the body (from a separate doc) in rich text? Even though I can do it manually?

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now