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

x
  • 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
        '.Display
    End With
    
    Set objEnv = Nothing
    Set objMailItem = Nothing

Open in new window

0
jwagman
Asked:
jwagman
  • 2
1 Solution
 
war1Commented:
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!
war1
0
 
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??
0
 
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?
0

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