Pause before send

Xenix

Registered User.
Local time
Today, 18:53
Joined
Oct 8, 2001
Messages
124
Can someone help me or know of a command to pause before I send a document. I run a command to create a PDF file with Acrobat distiller but the second part tries to send before the file has been created:

DoCmd.OpenReport "QuotationEmail", acNormal, "", "
=[Forms]![Quotation]!
"

Dim appOutl As Object
Dim MyNameSpace As Object
Dim myemail As Object

On Error GoTo Email_Err

Set appOutl = CreateObject("Outlook.Application")
Set MyNameSpace = appOutl.getNameSpace("MAPI")
Set myemail = appOutl.CreateItem(0)

myemail.to = [Forms]![Quotation]![Email2]

myemail.subject = "Honda Connectors Quotation"
myemail.body = "Please find attached Quotation"
myemail.Attachments.Add "c:\windows\desktop\Custom~1.pdf", , , "Custom~1.pdf"
myemail.Send

Regards

Mike
 
Am I correct in assuming that the line DoCmd.OpenReport "QuotationEmail", acNormal, "", "
=[Forms]![Quotation]!
"

is what creates your file?

If so why not put the lines of code that do the sending (second part)in a new procedure and call it from the Report_Activate or Report_Open Event

If i'm way off base let me know.

Jerid

[This message has been edited by Bushido121 (edited 04-03-2002).]
 
Yes my friend that line creates the file but
it also opens the file after it creates the PDF
frown.gif
I don't want that to happen
frown.gif
 
You could always set the report to visible=false so you can't see it open, then use the line DoCmd.Close acReport, "Name", acSaveNo to close it after it's been created, and put your send code in the Report_Close event.

This way the report opens, you can't see it, the file gets created, the report closes, the file gets sent.

Just a thought

Good Luck.

Jerid
 
Thank you Jerid,

But the problem is it's not the report that opens but the created report in acrobat reader. It's the PDF distiller
frown.gif
it auto opens the file.

Thank you for your advice & help

But looks like I am still stuck
frown.gif
 

Users who are viewing this thread

Back
Top Bottom