+ Reply to Thread
Results 1 to 4 of 4

Fixing a macro that creates a template in Outlook 2007

Hybrid View

  1. #1
    Registered User
    Join Date
    03-11-2013
    Location
    St. Louis, MO
    MS-Off Ver
    2007 & 2010
    Posts
    3

    Fixing a macro that creates a template in Outlook 2007

    I know almost nothing about writing code in VBA. I copy and pasted the following code to open a template.

    Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
    Sub MakeItem()
    Set newItem = Application.CreateItemFromTemplate("C:\Users\folder\template.oft")
    newItem.Display
    Set newItem = Nothing
    End Sub


    It works well except that every time I send the completed email it opens up VBA and displays the following error "Compile error: Expected End Sub" Does anybody know how I could fix this?

    **edit**

    This error message not only pops up when running the macro to send an email, but whenever I send any email.
    Last edited by kbuyle; 03-12-2013 at 08:48 AM.

  2. #2
    Registered User
    Join Date
    03-11-2013
    Location
    St. Louis, MO
    MS-Off Ver
    2007 & 2010
    Posts
    3

    Re: Fixing a macro that creates a template in Outlook 2007

    I could really use some help on this one. It seems like such a simple fix but I don't have the time to learn VB in order to fix it.

  3. #3
    Forum Contributor
    Join Date
    07-26-2012
    Location
    USA
    MS-Off Ver
    Excel 2007 & 2010
    Posts
    351

    Re: Fixing a macro that creates a template in Outlook 2007

    What are you trying to do? Did you put that code in Outlook or Excel? If you put it in Outlook, I'm of no help. But if you're trying to run a macro out of Excel, let me know what you're trying to accomplish and I might be able to help you get it sorted. Please provide specifics

  4. #4
    Registered User
    Join Date
    03-11-2013
    Location
    St. Louis, MO
    MS-Off Ver
    2007 & 2010
    Posts
    3

    Re: Fixing a macro that creates a template in Outlook 2007

    It is in Outlook. I am trying to get outlook to pull up a template so I can just start the macro, paste in a reference number and send the finished email out.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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