I want to move the emails from one folder to another folder based on the selection one of items in outlook. If i choose one email in outlook when i run the outlook VBA macro i want all similar subject of the email to be moved from that folder into another folder(we can sort by subject and move the email , this may be faster), also i want to calculate response time of first received email with same subject and the responded time of the email which i have replied at the last. Please assist
i have tried selecting one email and run the macro and it is moving to another folder correctly but i need all the similar subject of the has to be moved faster
Tried for moving one email by selecting the macro and it is working fine. but i want all the similar subject of the email has to be moved.I want to calculate the timing of the first email received and the email which i have responded at the latest.
Example subject of the email : Need data Received at 1 AM, i have acknowledged at 1 :10 AM and responded at 1:40 AM In that case i need to calculate the timings as 40 MIN
Sample VBA
Option Explicit
Sub MoveEml()
Dim ol As Outlook.Application
Dim ns As Outlook.NameSpace
Dim inFolder As Outlook.MAPIFolder
Dim olFolder As Outlook.MAPIFolder
Dim SubFolder As Outlook.MAPIFolder
Dim selItems As Selection
Dim myItem As Object
Dim SubItem As MailItems
Set ol = Outlook.Application
Set ns = ol.GetNamespace("MAPI")
Set inFolder = ol.Session.GetDefaultFolder(olFolderInbox)
Set olFolder = inFolder.Folders("Lyca")
Set SubFolder = inFolder.Folders("bakup")
' Set reference to the Selection.
Set selItems = ActiveExplorer.Selection
Set SubItem = selItems.Item.Subject
Debug.Print SubItem
' Loop through each item in the selection.
For Each myItem In selItems
myItem.Move SubFolder
Next
'MsgBox "All Done. Email converted to Plaintext.", vbOKOnly, "Message"
Set selItems = Nothing
End Sub
i have tried selecting one email and run the macro and it is moving to another folder correctly but i need all the similar subject of the has to be moved faster
Tried for moving one email by selecting the macro and it is working fine. but i want all the similar subject of the email has to be moved.I want to calculate the timing of the first email received and the email which i have responded at the latest.
Example subject of the email : Need data Received at 1 AM, i have acknowledged at 1 :10 AM and responded at 1:40 AM In that case i need to calculate the timings as 40 MIN
Sample VBA
Option Explicit
Sub MoveEml()
Dim ol As Outlook.Application
Dim ns As Outlook.NameSpace
Dim inFolder As Outlook.MAPIFolder
Dim olFolder As Outlook.MAPIFolder
Dim SubFolder As Outlook.MAPIFolder
Dim selItems As Selection
Dim myItem As Object
Dim SubItem As MailItems
Set ol = Outlook.Application
Set ns = ol.GetNamespace("MAPI")
Set inFolder = ol.Session.GetDefaultFolder(olFolderInbox)
Set olFolder = inFolder.Folders("Lyca")
Set SubFolder = inFolder.Folders("bakup")
' Set reference to the Selection.
Set selItems = ActiveExplorer.Selection
Set SubItem = selItems.Item.Subject
Debug.Print SubItem
' Loop through each item in the selection.
For Each myItem In selItems
myItem.Move SubFolder
Next
'MsgBox "All Done. Email converted to Plaintext.", vbOKOnly, "Message"
Set selItems = Nothing
End Sub