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.

I repeatedly have to send emails that are nearly identical except they have a different case number. I'd like to setup outlook to just ask me for the case number, fill it in the appropriate place in the body and subject of the email and then send it to a preset list of recipients (it's a static list of people).

I think some combination of Forms and Templates should be able to do this but I'm unsure how.

share|improve this question

1 Answer 1

A possible VBA solution

Sub Boilerplate_CaseNumber()

Dim objMail As MailItem
Dim allRecipients As Recipients

Dim uPrompt As String
Dim uCaseNum As String

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

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

uPrompt = "What is the case number?"
uCaseNum = InputBox(prompt:=uPrompt, Title:="Case number")

objMail.Subject = "Here is the Case Number: " & uCaseNum
objMail.Body = "Hello," & vbCrLf & vbCrLf & _
   "The case number is: " & uCaseNum & "." & vbCrLf & vbCrLf & _
   "Yours," & vbCrLf & vbCrLf & _
   "Mykroft"

SendKeys "^{END}"

objMail.Display

Set objMail = Nothing
Set allRecipients = Nothing

End Sub


Sub Boilerplate_CaseNumber_WordEditor()

Dim objMail As MailItem
Dim allRecipients As Recipients

Dim uPrompt As String
Dim uCaseNum As String

Dim objDoc
Dim objSel

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

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

uPrompt = "What is the case number?"
uCaseNum = InputBox(prompt:=uPrompt, Title:="Case number")

objMail.Subject = "Here is the Case Number: " & uCaseNum
objMail.Display

Set objDoc = Application.ActiveInspector.WordEditor
Set objSel = objDoc.Windows(1).selection
objSel.TypeText Text:="Hello," & vbCrLf & vbCrLf & _
   "The case number is: " & uCaseNum & "." & vbCrLf & vbCrLf & _
   "Yours," & vbCrLf & vbCrLf & _
   "Mykroft"

Set objDoc = Nothing
Set objSel = Nothing
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

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.