Send Emails via Excel VBA one at a time -


i using ms excel , outlook 2013. trying automate excel spreadsheet sends 5 emails specified address using outlook.

the trick want each message display 1 @ time , move on next message when user either hits send or closes message. here have far:

    sub send_emails()      dim outapp object: set outapp = createobject("outlook.application")     dim outmail object: set outmail = outapp.createitem(0)     'send email    outmail       .to = "john.doe@mycompany.com"       .subject = "this subject"       .body = "this message"       .display    end     on error resume next:    outmail = nothing    outapp = nothing    end sub     sub send_five_emails()    = 1 5 'send email 5 times        call send_emails    next    end sub 

the problem code displays 5 message windows @ once. there way make close event of 1 message window trigger displaying of next one, make them appear 1 @ time?

i appreciate help.

use .display (true)

the expression.display(modal) argument used objects except explorer , mapifolder objects, true make window modal. the default value false.

see display method on msdn


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -