Hi, So I see this macro, but don't see a "sun name" to replace with the code you provide in post #19:
Option Explicit
Private WithEvents oExpl As Explorer
Private WithEvents oItem As MailItem
Private bDiscardEvents As Boolean
Private Sub Application_Startup()
Set oExpl = Application.ActiveExplorer
bDiscardEvents = False
End Sub
Private Sub oExpl_SelectionChange()
On Error Resume Next
Set oItem = oExpl.Selection.Item(1)
End Sub
' Reply
Private Sub oItem_Reply(ByVal Response As Object, Cancel As Boolean)
Dim oAtt As Attachment
Dim strAtt As String
Dim olInspector As Outlook.Inspector
Dim olDocument As Word.Document
Dim olSelection As Word.Selection
If bDiscardEvents Or oItem.Attachments.Count = 0 Then
Exit Sub
End If
Cancel = True
bDiscardEvents = True
strAtt = ""
For Each oAtt In oItem.Attachments
If oAtt.Size > 5200 Then
strAtt = strAtt & "<<" & oAtt.FileName & ">> "
End If
Next oAtt
Dim oResponse As MailItem
Set oResponse = oItem.Reply
oResponse.Display
Set olInspector = Application.ActiveInspector()
Set olDocument = olInspector.WordEditor
Set olSelection = olDocument.Application.Selection
olSelection.InsertBefore strAtt
bDiscardEvents = False
Set oItem = Nothing
End Sub
' Reply All
Private Sub oItem_ReplyAll(ByVal Response As Object, Cancel As Boolean)
Dim oAtt As Attachment
Dim strAtt As String
Dim olInspector As Outlook.Inspector
Dim olDocument As Word.Document
Dim olSelection As Word.Selection
If bDiscardEvents Or oItem.Attachments.Count = 0 Then
Exit Sub
End If
Cancel = True
bDiscardEvents = True
strAtt = ""
For Each oAtt In oItem.Attachments
If oAtt.Size > 5200 Then
strAtt = strAtt & "<<" & oAtt.FileName & ">> "
End If
Next oAtt
Dim oResponse As MailItem
Set oResponse = oItem.ReplyAll
oResponse.Display
Set olInspector = Application.ActiveInspector()
Set olDocument = olInspector.WordEditor
Set olSelection = olDocument.Application.Selection
olSelection.InsertBefore strAtt
bDiscardEvents = False
Set oItem = Nothing
End Sub
Option Explicit
Private WithEvents oExpl As Explorer
Private WithEvents oItem As MailItem
Private bDiscardEvents As Boolean
Private Sub Application_Startup()
Set oExpl = Application.ActiveExplorer
bDiscardEvents = False
End Sub
Private Sub oExpl_SelectionChange()
On Error Resume Next
Set oItem = oExpl.Selection.Item(1)
End Sub
' Reply
Private Sub oItem_Reply(ByVal Response As Object, Cancel As Boolean)
Dim oAtt As Attachment
Dim strAtt As String
Dim olInspector As Outlook.Inspector
Dim olDocument As Word.Document
Dim olSelection As Word.Selection
If bDiscardEvents Or oItem.Attachments.Count = 0 Then
Exit Sub
End If
Cancel = True
bDiscardEvents = True
strAtt = ""
For Each oAtt In oItem.Attachments
If oAtt.Size > 5200 Then
strAtt = strAtt & "<<" & oAtt.FileName & ">> "
End If
Next oAtt
Dim oResponse As MailItem
Set oResponse = oItem.Reply
oResponse.Display
Set olInspector = Application.ActiveInspector()
Set olDocument = olInspector.WordEditor
Set olSelection = olDocument.Application.Selection
olSelection.InsertBefore strAtt
bDiscardEvents = False
Set oItem = Nothing
End Sub
' Reply All
Private Sub oItem_ReplyAll(ByVal Response As Object, Cancel As Boolean)
Dim oAtt As Attachment
Dim strAtt As String
Dim olInspector As Outlook.Inspector
Dim olDocument As Word.Document
Dim olSelection As Word.Selection
If bDiscardEvents Or oItem.Attachments.Count = 0 Then
Exit Sub
End If
Cancel = True
bDiscardEvents = True
strAtt = ""
For Each oAtt In oItem.Attachments
If oAtt.Size > 5200 Then
strAtt = strAtt & "<<" & oAtt.FileName & ">> "
End If
Next oAtt
Dim oResponse As MailItem
Set oResponse = oItem.ReplyAll
oResponse.Display
Set olInspector = Application.ActiveInspector()
Set olDocument = olInspector.WordEditor
Set olSelection = olDocument.Application.Selection
olSelection.InsertBefore strAtt
bDiscardEvents = False
Set oItem = Nothing
End Sub