Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

There was a question on adding a macro in Outlook 2010 but the answer was a little unclear to me. I want a specific line of text to appear in an email that is sent to a specific group of people (example: agenda editors). It is "These are the current changes for July 23, 2012 (date automatically updates)." Where do I configure this or put the text for this?

share|improve this question

1 Answer 1

Try this

Sub Boilerplate_Agenda_Editors()

    Dim objMail As MailItem
    Dim allRecipients As Recipients

    Set objMail = Application.CreateItem(olMailItem)
    Set allRecipients = objMail.Recipients

    allRecipients.Add "Your distribution list name inside the quotes"
    allRecipients.ResolveAll

    objMail.Subject = "Attention Agenda Editors"
    objMail.Body = "These are the current changes for " & Format(Now, "mmmm dd, yyyy") & "."

    SendKeys "^{END}"

    objMail.Display

    Set objMail = Nothing
    Set allRecipients = Nothing

End Sub

Editor and button help - http://www.slipstick.com/developer/how-to-use-outlooks-vba-editor/

Macro security should be set to medium.

Button help - http://www.howto-outlook.com/howto/macrobutton.htm

share|improve this answer
    
you can put this code into Application_ItemSend event instead if you want complete automation –  tumchaaditya Aug 2 '12 at 6:55
    
@tumchaaditya - Only if you want every email you send to say the same thing, except for the date. :) –  niton Aug 2 '12 at 10:32
    
you could check whom the mail is being sent to in the macro.. –  tumchaaditya Aug 3 '12 at 3:51

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.