Dear All,
I have a short and simple macro that replies to a specific email found in my Outlook sent folder based on the subject.
But the issue is that this code opens all mails with that subject. But I would need only the latest reply email to be remained opened (with the entire mail chin). Is there a simple way to do that? Can you help me please?
I'd like to use this code for automatic reminder sending from Excel.
Thank you for your help in advance,
Laszlo
I have a short and simple macro that replies to a specific email found in my Outlook sent folder based on the subject.
But the issue is that this code opens all mails with that subject. But I would need only the latest reply email to be remained opened (with the entire mail chin). Is there a simple way to do that? Can you help me please?
I'd like to use this code for automatic reminder sending from Excel.
Code:
Sub ReplyMail_No_Movements()
Dim olApp As Outlook.Application
Dim olNs As Namespace
Dim Fldr As MAPIFolder
Dim olMail As Variant
Dim i As Integer
Set olApp = New Outlook.Application
Set olNs = olApp.GetNamespace("MAPI")
Set Fldr = olNs.GetDefaultFolder(olFolderSentMail)
i = 1
For Each olMail In Fldr.Items
If InStr(olMail.Subject, ActiveCell.Value) <> 0 Then
With olMail.ReplyAll
.Display
'.Save
'.Close 1
'.Send
End With
i = i + 1
End If
Next olMail
Set olMail = Nothing
Set olApp = Nothing
End Sub
Thank you for your help in advance,
Laszlo