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 !
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.
My Recommended Reading:
Volatility
Sumproduct & Arrays
Pivot Intro
Email from XL - VBA & Outlook VBA
Function Dictionary & Function Translations
Dynamic Named Ranges
I answered prematurely before I automatically thought it was XL related question so apologies... below would be an OL macro:
I've undeleted my prior post on the off chance you were talking from XL...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
My Recommended Reading:
Volatility
Sumproduct & Arrays
Pivot Intro
Email from XL - VBA & Outlook VBA
Function Dictionary & Function Translations
Dynamic Named Ranges
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
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
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks