Wie bringe ich Outlook dazu, Informationen automatisch auszufüllen?

Wie bringe ich Outlook dazu, Informationen automatisch auszufüllen?

Ich muss immer wieder E-Mails verschicken, die fast identisch sind, aber unterschiedliche Fallnummern haben. Ich möchte Outlook so einrichten, dass es mich nur nach der Fallnummer fragt, diese an der entsprechenden Stelle im Text und Betreff der E-Mail einträgt und sie dann an eine voreingestellte Empfängerliste (es ist eine statische Personenliste) sendet.

Ich denke, dass dies mit einer Kombination aus Formularen und Vorlagen möglich sein sollte, bin mir aber nicht sicher, wie.

Antwort1

Eine mögliche VBA-Lösung

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- und Button-Hilfe -http://www.slipstick.com/developer/how-to-use-outlooks-vba-editor/

Die Makrosicherheit sollte auf „Mittel“ eingestellt sein.

Schaltflächenhilfe -http://www.howto-outlook.com/howto/macrobutton.htm

verwandte Informationen