+ Reply to Thread
Results 1 to 2 of 2

Outlook VBA - Recurring Email with doc embedded into email body

  1. #1
    Registered User
    Join Date
    05-10-2020
    Location
    Manchester, England
    MS-Off Ver
    2010
    Posts
    7

    Outlook VBA - Recurring Email with doc embedded into email body

    Hi all,

    I'm hoping someone can help me.

    I'd like to set up a recurring email within Outlook. I've been told that you can't schedule an email to send but I've been given a code to convert a calendar invite into an email (as its a calendar invite I can schedule it to send when I want) The only thing is that I can't get the invite to send with the doc embedded into it. It just skips this out and sends a blank email.

    Would someone be able to take a look at the below and advise? I'd be really grateful! Let me know if you need any other info

    Private Sub Application_Reminder(ByVal Item As Object)

    Dim objMsg As MailItem
    Dim objApp As AppointmentItem
    Dim Att As Object
    Dim filePath As String
    Set objMsg = Application.CreateItem(olMailItem)

    MsgBox "Email Tiggered"

    'message is appointment
    If Item.MessageClass <> "IPM.Appointment" Then Exit Sub
    'The appointment is set as "Send Schedule Recurring Email" Category
    If Item.Categories <> "Send Schedule Recurring Email" Then Exit Sub

    'MsgBox Item.MessageClass
    'MsgBox Item.Categories
    'MsgBox Item.Location
    'MsgBox Item.Subject
    'MsgBox objMsg.Body
    'MsgBox Environ("USERPROFILE")
    'to get the path of the email attachment
    tmpFolder = Environ("USERPROFILE")

    'Add each attachment to email object to be sent
    For Each Att In Item.Attachments
    Embed.Object = ("\\TCFSH03\3087355$\My Pictures\Recurring Emails\EPICStarAwards")
    objMsg.Attachments.Add ("\\TCFSH03\3087355$\My Pictures\Recurring Emails")
    Kill filePath
    Next Att

    'send email object
    objMsg.To = Item.Location
    objMsg.Subject = Item.Subject
    objMsg.Body = Item.Body
    objMsg.Send
    Set objMsg = Nothing

    End Sub

  2. #2
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,908

    Re: Outlook VBA - Recurring Email with doc embedded into email body

    Here is a sub-subroutine to which I pass parameters. It uses .Attachments.Add
    Please Login or Register  to view this content.
    One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.

    A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Generating Outlook Email and inseting chart into email with Text body.
    By Hyperion1571 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-17-2019, 12:41 PM
  2. Replies: 0
    Last Post: 05-28-2018, 09:53 AM
  3. vba pull data from outlook body of email through email or subject of mail into excel
    By breadwinner in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-01-2014, 04:37 AM
  4. [SOLVED] Using Exell VBA to launch Outlook Email while separating lines in the body of Outlook.
    By Tazyote in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-27-2013, 01:18 PM
  5. Recurring Task / Delayed Email in Outlook 2010
    By sme001 in forum Outlook Formatting & Functions
    Replies: 0
    Last Post: 03-12-2013, 11:41 AM
  6. export outlook 2007 email into excel with subject and body of email
    By akulka58 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-25-2013, 02:37 PM
  7. Replies: 2
    Last Post: 08-01-2012, 02:47 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1