问题
I have a macro built for VBA Outlook where I can reply all, using an attachment. This is the code:
Sub Estimate()
Dim origEmail As MailItem
Dim replyEmail As MailItem
Dim s() As String
Dim add As String
Set origEmail = Application.ActiveWindow.Selection.Item(1)
Set replyEmail = Application.CreateItemFromTemplate("C:\template.oft")
s = Split(origEmail.CC & ";" & replyEmail.CC, ";")
replyEmail.HTMLBody = replyEmail.HTMLBody & origEmail.Reply.HTMLBody
replyEmail.Subject = "RE: " + origEmail.Subject
replyEmail.To = origEmail.Sender
replyEmail.Display
End Sub
It's working ok except in cases where a person has more than a email linked to AD. In that case in the reply email I get the name of the person instead of the email. So the issue here is that it's copying the names from the original email and than its placing those names in the reply email. How can I change the code so that it copies the real email fro the original email and place them in the reply email?
来源:https://stackoverflow.com/questions/65899850/outloook-vba-macro-to-reply-all-with-oft-template