Under the gun, HELP!!!

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!
 
M

Mark Andrews

If you are sending multiple emails you might want to look into an SMTP
component.
I use Ostrosoft's (however I use a older version, they changed it a bit in
this new version).
There are probably a dozen or so SMTP components out there in the market
(most are about $50)

Usually one dll and a few lines of code to send the email.

You could check out my donation software if you want to see it in action,
try sending email to 15 contacts as an example etc....

HTH,
Mark Andrews
RPT Software
http://www.rptsoftware.com
http://www.donationmanagementsoftware.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top