+ Reply to Thread
Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    11-04-2008
    Location
    Virginia
    Posts
    28

    Create base email.

    I have an email that I send often, just with some variable information. I would like to have a macro that creates the base information, then leaves the email open for me to change the variable parts. I tried using the basic vba formats then commenting out the .SEND to hopefully leave the email unsent - No Luck. Any ideas how I can leave it partly filled in, but unsent ?

    Thanks. The code I used is shown below.

    Bob

    Code:
    Sub Badge()
        Set OutProg = CreateObject("outlook.application")
        Set OutM = OutProg.CreateItem(OlItemType.olMailItem)
        With OutM
            .Subject = "Just testing."
            .To = "johndoe@yahoo.com"
            .Body = "Here we go"
    Rem   .Send
        End With
    End Sub
    Last edited by rfhall50; 06-16-2009 at 02:07 PM. Reason: DonkeyOte is the best !

  2. #2
    Forum Moderator DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Suffolk, UK
    MS-Off Ver
    2002, 2007 & 2010
    Posts
    21,379

    Re: Create base email.

    You could just use a hyperlink, ie enter the following into a cell directly:

    mailto:johndoe@yahoo.com&subject=Just%20Testing&body=Here%20we%20go

    clicking on that should bring up your new mail dialog.

  3. #3
    Forum Moderator DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Suffolk, UK
    MS-Off Ver
    2002, 2007 & 2010
    Posts
    21,379

    Re: Create base email.

    I answered prematurely before I automatically thought it was XL related question so apologies... below would be an OL macro:

    Code:
    Sub Badge()
    Dim OLi As MailItem
    Set OLi = Application.CreateItem(olMailItem)
    With OLi
        .To = "johndoe@yahoo.com"
        .Subject = "Just testing"
        .Body = "Here we go"
        .Display
    End With
    Set OLi = Nothing
    End Sub
    I've undeleted my prior post on the off chance you were talking from XL...

  4. #4
    Registered User
    Join Date
    11-04-2008
    Location
    Virginia
    Posts
    28

    Re: Create base email.

    DonkeyOte ...

    Thank you so much. As you were sending your second response, I was tucking away that hyperlink idea for a future challenge. Your second idea was EXACTLY what I was looking for.

    GREAT JOB ! Thanks again ...

    Bob

  5. #5
    Forum Guru martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    10,477

    Re: Create base email.

    in oulook you can just do a mail as you like then save it as a .oft
    file/save as .oft
    (if outlook template is not in the menu, its because you are using word as text editor,turn it of create template save somewhere turn back on word as editor)
    then you can assign template to a button on toolbar.
    Mojito connoisseur and a dabbler in Cisco
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

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.2.0