none
opening Outlook email template from Excel VBA RRS feed

  • Question

  • Hi Guys,

    i am facing this annoying issue since sometime yesterday. I have written down a code and was confident it will work but for some reason doesnt.

    After the dialogue box opens i browse to my email template and select it but ti says object doesnt support this property. Any help is greatly appreciated!!! Thanks much.


    Sub MorningOutlookTemplate()

    Dim myolapp As Object

    morn_template = Application.GetOpenFilename(FileFilter:="Outlook Template (*.oft), *.oft", Title:="Please select a file")


        If (morn_template <> False) Then GoTo fine
         MsgBox ("Exiting Tool Run!!!!!")
    fine:
    Range("H11") = morn_template

    Set myolapp = CreateObject("Outlook.Application")
    myolapp.Session.Logon
    Set openMsg = Application.CreateItemFromTemplate(morn_template)
    openMsg.Display


    End Sub
    Wednesday, October 15, 2014 7:55 AM

Answers

  • Hi,

    The Application object for Excel doesn't provide CreateItemFromTemplate method. We need to use the application of Outlook, please try the code below:

    myolapp.CreateItemFromTemplate(morn_template)

    Hope it is helpful.

    Best regards

    Fei


    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.

    Thursday, October 16, 2014 2:08 AM
    Moderator

All replies

  • Hi,

    Waiting for your help guys!!!!   :)

    Wednesday, October 15, 2014 1:15 PM
  • Hello,

    Did you try to debug? What line of code causes the issue?

    What actual value is passed to the CreateItemFromTemplate method?

    Wednesday, October 15, 2014 2:37 PM
  • Hi,

    The Application object for Excel doesn't provide CreateItemFromTemplate method. We need to use the application of Outlook, please try the code below:

    myolapp.CreateItemFromTemplate(morn_template)

    Hope it is helpful.

    Best regards

    Fei


    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.

    Thursday, October 16, 2014 2:08 AM
    Moderator