none
Excel Templates straight to Outlook RRS feed

  • Question

  • Hi,

    I collated a gazillion e-mail templates in Excel for one of the divisions I am supporting now. 

    Can I automate that using a Userform and can send it directly to Outlook?

    Will you be able to tell me if this is possible?

    Conditions:

    *All categories - A person will just choose from a dropdown list to get the e-mail template he/she needs.

    * When he/she has finally chosen the e-mail template he/she needs, I want the person to be able to edit and send it using Outlook where the TO: and CC: (if necessary) is automatically inserted too.

    Am I asking a lot? Sorry. Not really techy. I saw how helpful you have been to other subscribers.

    I'm just not certain if my questions are even acceptable.

    Hoping for your swift response.

    Thank you in advance,

    Khaye

    Monday, June 13, 2016 9:27 AM

Answers

  • Hi Khaye,

    Do you mean you want to create an email with default to and cc from email template in Excel VBA? If so, I would suggest you add Microsoft Outlook 15.0 Object Library and use outlook object to send email.

    Here is a simple code:

    Sub CreateEmail()
        Dim oApp As Outlook.Application
        Dim MyItem As Outlook.MailItem
        Set oApp = GetObject(, "Outlook.Application")
        Set MyItem = oApp.CreateItemFromTemplate("C:\statusrep.oft") 'oApp.CreateItem(olMailItem)
        MyItem.To = "TestTc"
        MyItem.CC = "TestCC"
        MyItem.Display
    End Sub

    Best Regards,

    Edward


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Tuesday, June 14, 2016 5:49 AM

All replies

  • How will your Excel code "automatically" insert the To: field? From where do you collect that information?

    Best regards, George

    Monday, June 13, 2016 11:54 AM
  • If you'd build an Outlook Add-in for this you could quite easily do so. An Outlook add-in is a web based app (html/css/js) that shows next to email items and allows you to manipulate the email item itself (of which one of the editable properties is the to line). For more info on add-ins in general: http://dev.office.com/getting-started/addins. More info on manipulating the to line specifically: http://dev.office.com/reference/add-ins/outlook/1.1/Office.context.mailbox.item.

    Hope this helps.

    Jesse

    Monday, June 13, 2016 1:36 PM
  • Hi Khaye,

    Do you mean you want to create an email with default to and cc from email template in Excel VBA? If so, I would suggest you add Microsoft Outlook 15.0 Object Library and use outlook object to send email.

    Here is a simple code:

    Sub CreateEmail()
        Dim oApp As Outlook.Application
        Dim MyItem As Outlook.MailItem
        Set oApp = GetObject(, "Outlook.Application")
        Set MyItem = oApp.CreateItemFromTemplate("C:\statusrep.oft") 'oApp.CreateItem(olMailItem)
        MyItem.To = "TestTc"
        MyItem.CC = "TestCC"
        MyItem.Display
    End Sub

    Best Regards,

    Edward


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Tuesday, June 14, 2016 5:49 AM