Consulting

Results 1 to 4 of 4

Thread: Forward latest sent items and Copy

  1. #1
    VBAX Newbie
    Joined
    Jan 2014
    Posts
    5
    Location

    Forward latest sent items and Copy

    Is there a way to forward the latest sent items and copy the whole email.

  2. #2
    probably, but i am not sure that i understand what you want to do

  3. #3
    VBAX Newbie
    Joined
    Jan 2014
    Posts
    5
    Location
    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.

  4. #4
    you can try like
    Set 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 can change somedate to whatever value you consider to be recent, maybe like now - 2 hours
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •