prompt for Attachments

Xenix

Registered User.
Local time
Today, 11:30
Joined
Oct 8, 2001
Messages
124
Hello,

I want Access to prompt for Attachments when I send an email.

I currently use the line:
myemail.Attachments.Add "c:\progra~1\adobe\acroba~1.0\PDFOut~1\Custom~1.pdf", , , "Custom~1.pdf"

But now we are going to place customer quotes in folders and I want to be prompted to save this to the relavent folder?

Thank you in advance

Mike
 
Your question is confusing. You say you want to prompt for the attachment, then prompt to save it to a folder. Are you trying to prompt for where the file is you want to attach, or prompt to save something to a folder, or both? If you use VBA you can prompt for the location of a file, you can even use common dialog to use the standard windows OPEN dialog. Then feed the path/file to your code in a variable. Saving can be done the same way but I I am not sure that is what you meant.
 
I am trying to prompt for where the file is I want to attach.

Thank you for you help
 
I would use a dialog type form to ask for the file with a browse option to use windows Common Dialog. Than stuff the path/filename in a variable/s and pass the variable to your myemail.Attachments.Add statement.
 
Thank you Fofa but how do I create a :dialog type form to ask for the file with a browse option.

Kind regards

Mike

P.S. my current code is:


DoCmd.OpenReport "QuotationEmailCables", acNormal, "", "
=[Forms]![QuotationCables]!
"
MsgBox "Please press OK after previewing the quotation in the PDF viewer to send E-Mail", vbOKOnly, "Email Quotation"
'------------------------------------------------------------
' Send Email
' Takes the to message from the form and sends it via outlook
' Also attaches the files listed below
'------------------------------------------------------------
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)

'MsgBox Forms!Customer!Email
myemail.To = Forms!Customer!Email
myemail.bcc = Forms!Customer!LocalSalesEmail

myemail.subject = "Honda Connectors Quotation"
myemail.body = "Please see attached PDF file"
myemail.attachments.Add "c:\progra~1\adobe\acroba~1.0\PDFOut~1\Custom~1.pdf", , , "Custom~1.pdf"
If Forms!Customer!Terms = False Then
myemail.attachments.Add "g:\database\terms.pdf", , , "terms.pdf"
Forms!Customer!Terms = True
End If
 
Last edited:
Somewhere in your process, you need to open a new form and stop processing. This form basically would ask for a file, with a browse button using windows common dialog (see attached example A97 version). This form would (depends on your implementation) would have like 2 buttons, No Attachments, OK and if there are attachments (OK button), you pickup the path/filename from this form and then do your Email send thing. If there are no other attachments, you don't need to worry about it then.
 

Attachments

Users who are viewing this thread

Back
Top Bottom