Can't attach a document to a rich text document

Posted on 2009-02-23
Last Modified: 2012-05-06
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 = ""

        .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

Question by:jwagman
    LVL 97

    Accepted 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!

    Author Comment

    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??

    Author Comment

    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?

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Granting full access permission allows users to access mailboxes present in their database. By giving full access permission one can open and read the content of any mailbox but cannot send emails from that mailbox.
    Set OWA language and time zone in Exchange for individuals, all users or per database.
    This Experts Exchange video Micro Tutorial shows how to tell Microsoft Office that a word is NOT spelled correctly. Microsoft Office has a built-in, main dictionary that is shared by Office apps, including Excel, Outlook, PowerPoint, and Word. When …
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now