Consulting

Results 1 to 4 of 4

Thread: Rules - Start Application After Sending Email

  1. #1

    Rules - Start Application After Sending Email

    My outlook sends an email at a certain time each morning. I need a way to start a new file after sending that first message each morning. In Rules, there is an easy way to do this after receiving an email through start application, but there is no option to start an application after sending an email.

    Please note, the message stays in the outbox for two minutes before being sent, I would hope that the file or application starts after it is actually sent. Any ideas?

  2. #2
    you can use the itemsend event to run code when a message is sent, the code can monitor the outbox folder to make sure the item has been sent

  3. #3
    I am still so new with vba... I do not know the syntax at all.

    I am guessing it would be something with an If :
    If (itemsend syntax) = sent
    then start excel application

    Am I in the right ballpark?

  4. #4
    close but no cigar

    try like
    Private Sub Application_ItemSend(ByVal item As Object, Cancel As Boolean)
    Dim mi As MailItem, mybcc As Recipient, ob As Items
    If item.Subject = mycriteria Then  ' match some criteria to subject or other, so not all emails will open excel
        Set ob = GetNamespace("mapi").GetDefaultFolder(olFolderOutbox).Items
        Do While ob.Count > 0   ' wait till outbox is empty
            DoEvents
        Loop
        Set xl = CreateObject("excel.application")
        xl.Visible = True
        'leave visible for user, or open appropriate workbook, what ever
    End If
    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
  •