Welcome to the Excel Forum

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed.

Please Register to Remove these Ads

Please Register to Remove these Ads



Reply
  #1  
Old 06-16-2009, 09:24 AM
rfhall50 rfhall50 is offline
Registered User
 
Join Date: 04 Nov 2008
Location: Virginia
Posts: 23
rfhall50 is becoming part of the community
Create base email.

Please Register to Remove these Ads

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 01:07 PM. Reason: DonkeyOte is the best !
Reply With Quote
  #2  
Old 06-16-2009, 11:43 AM
DonkeyOte's Avatar
DonkeyOte DonkeyOte is offline
Forum Guru
 
Join Date: 22 Oct 2008
Location: Suffolk, UK
MS Office Version:2002 & 2007
Posts: 13,645
DonkeyOte has a reputation beyond repute DonkeyOte has a reputation beyond repute DonkeyOte has a reputation beyond repute DonkeyOte has a reputation beyond repute DonkeyOte has a reputation beyond repute DonkeyOte has a reputation beyond repute DonkeyOte has a reputation beyond repute DonkeyOte has a reputation beyond repute DonkeyOte has a reputation beyond repute DonkeyOte has a reputation beyond repute DonkeyOte has a reputation beyond repute
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.
Reply With Quote
  #3  
Old 06-16-2009, 12:26 PM
DonkeyOte's Avatar
DonkeyOte DonkeyOte is offline
Forum Guru
 
Join Date: 22 Oct 2008
Location: Suffolk, UK
MS Office Version:2002 & 2007
Posts: 13,645
DonkeyOte has a reputation beyond repute DonkeyOte has a reputation beyond repute DonkeyOte has a reputation beyond repute DonkeyOte has a reputation beyond repute DonkeyOte has a reputation beyond repute DonkeyOte has a reputation beyond repute DonkeyOte has a reputation beyond repute DonkeyOte has a reputation beyond repute DonkeyOte has a reputation beyond repute DonkeyOte has a reputation beyond repute DonkeyOte has a reputation beyond repute
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...
Reply With Quote
  #4  
Old 06-16-2009, 01:06 PM
rfhall50 rfhall50 is offline
Registered User
 
Join Date: 04 Nov 2008
Location: Virginia
Posts: 23
rfhall50 is becoming part of the community
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
Reply With Quote
  #5  
Old 06-16-2009, 06:57 PM
martindwilson's Avatar
martindwilson martindwilson is offline
Forum Guru
 
Join Date: 23 Jun 2007
Location: London,England
MS Office Version:office 97 ,2003 ,2007
Posts: 6,073
martindwilson Has a higher level of understanding martindwilson Has a higher level of understanding martindwilson Has a higher level of understanding martindwilson Has a higher level of understanding martindwilson Has a higher level of understanding martindwilson Has a higher level of understanding martindwilson Has a higher level of understanding
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


recommended reading
wiki Mojito

how to say no convincingly

most important think you need
Reply With Quote


Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Forum Jump