Is there a way to forward the latest sent items and copy the whole email.
Is there a way to forward the latest sent items and copy the whole email.
probably, but i am not sure that i understand what you want to do
suppose i am sending an email from outlook, after sending what i want to do is the email which has been sent recently will be forwarded automatically and the entire email body will be copied in excel sheet by vba.
you can try like
you can change somedate to whatever value you consider to be recent, maybe like now - 2 hoursSet apps = Session.GetDefaultFolder(olFolderSentMail).Items somedate = "09/05/2013" Set recent = apps.Restrict("[SentOn] > '" & somedate & "'") For Each mi In recent.Items mi.To = "someone@somewhere.com" mi.Send Body = mi.Body 'insert body to excel workbook Next
you could also use the item sent event to do automatically
Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean) Set mybcc = item.Recipients.Add = "someone@somewhere.com" mybcc.Type olBCC ' insert item.body to excel end sub