M
mr3316a
I am running Access 2007
I have some code that generates excel files based on parameters set in a
form, creates an e-mail in Outllook, and adds the files as attachments. Then
stars the next files an e-mail. When I run this in debug mode everything
works fine. After the looping is complete, the form closes and I have a bunch
of e-mails in Outlook waiting for me to click send on each.
When I run the same code NOT in debug mode, after the 1st e-mail I get a
run-time error 2046 " The command or action 'Output To' isn't available now".
If I comment the function where Outlook is called, the code runs fine. Is
there a way that I can programaticly stop the code after the 1st e-mail is
completed, and automaticly restart after I click the send e-mail button in
Outlook!
I have some code that generates excel files based on parameters set in a
form, creates an e-mail in Outllook, and adds the files as attachments. Then
stars the next files an e-mail. When I run this in debug mode everything
works fine. After the looping is complete, the form closes and I have a bunch
of e-mails in Outlook waiting for me to click send on each.
When I run the same code NOT in debug mode, after the 1st e-mail I get a
run-time error 2046 " The command or action 'Output To' isn't available now".
If I comment the function where Outlook is called, the code runs fine. Is
there a way that I can programaticly stop the code after the 1st e-mail is
completed, and automaticly restart after I click the send e-mail button in
Outlook!