Hallo,
ich versuche ein Makro für die gleichzeitige Beantwortung mehrerer selektierter Mails im Posteingang zu verwenden und habe unter diesem Link auch ein passendes Makro dafür gefunden:
https://www.datanumen.com/blogs/batch-reply-multiple-emails-content-outlook/
Problem ist:
- der Eintrag "Same Reply" in der Auswahlliste erscheint nicht (nach der Mailselektion und rechtem Mausklick)
- Bei manuellem Makrostart wird die Vorlage an die selektierten Mails als Antwort versendet, aber ohne den Anhang (kleines Bild) den ich in der Vorlage eingefügt habe
Da ich mich kaum als Anfänger bezeichnen dürfte was Makros angeht, würde ich mich über eine hilfreiche Antwort sehr freuen.
Vielen Dank
Marvin
Sub Application_ItemContextMenuDisplay(ByVal CommandBar As Office.CommandBar, ByVal Selection As Selection)
Dim objCommandBarButton As Office.CommandBarButton
If (Selection.Count > 1) And (Selection.Item(1).Class = olMail) Then
Set objCommandBarButton = CommandBar.Controls.Add(msoControlButton)
'Add a "Same Reply" option to the context menu
With objCommandBarButton
.Style = msoButtonIconAndCaption
.Caption = "Same Reply"
.FaceId = 355
.OnAction = "Project1.ThisOutlookSession.SendSameReply"
End With
End If
End Sub
Sub SendSameReply()
Dim strTemplate As String
Dim objTemplateReply As Outlook.MailItem
Dim strHTMLBody As String
Dim objSelection As Outlook.Selection
Dim i As Long
Dim objReply As Outlook.MailItem
'Input the name of the previously saved template
strTemplate = InputBox("Enter the name of template message:", , "Template Reply")
Set objTemplateReply = Application.CreateItemFromTemplate("Q:\Outlook-Vorlagen\" & strTemplate & ".oft")
strHTMLBody = objTemplateReply.HTMLBody
Set objSelection = Application.ActiveExplorer.Selection
For i = objSelection.Count To 1 Step -1
Set objReply = objSelection(i).Reply
With objReply
.HTMLBody = strHTMLBody & objReply.HTMLBody
.Send
End With
Next
End Sub
|