
케이스 번호가 다르다는 점을 제외하면 거의 동일한 이메일을 반복해서 보내야 합니다. 케이스 번호를 물어보고 이메일 본문과 제목의 적절한 위치에 입력한 다음 미리 설정된 수신자 목록(정적인 사람 목록)으로 보내도록 Outlook을 설정하고 싶습니다.
나는 양식과 템플릿을 조합하여 이 작업을 수행할 수 있어야 한다고 생각하지만 어떻게 해야 할지 잘 모르겠습니다.
답변1
가능한 VBA 솔루션
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
편집기 및 버튼 도움말 -http://www.slipstick.com/developer/how-to-use-outlooks-vba-editor/
매크로 보안은 중간으로 설정해야 합니다.