Email address reference in SendObject

S

standridgekelly

Hi, I am trying to set up a macro to open a report (which has a
selection criteria to select one invoice), and then use SendObject to
create a PDF to the customer to whom the invoice belongs. Of course,
their email address is stored in a field in my customers table. Can I
reference this field in the macro for the email TO: field?

Thanks,
Kelly Standridge
 
A

Arvin Meyer [MVP]

I don't think that you can send a PDF with SendObject. I'm not sure because
this particular machine doesn't have Office 2007 on it to check that
version. I do know that it is impossible with earlier versions. You can,
however, send a Snapshot with SendObject.

You can use a control reference in either a macro or VBA. Use:

Forms!YourFormName!YourTextboxName

If you need to send a PDF, you can do it with Outlook. Here's the code:

http://www.datastrat.com/Code/OutlookEmail.txt
 
S

standridgekelly

I don't think that you can send a PDF with SendObject. I'm not sure because
this particular machine doesn't have Office 2007 on it to check that
version. I do know that it is impossible with earlier versions. You can,
however, send a Snapshot with SendObject.

You can use a control reference in either a macro or VBA. Use:

Forms!YourFormName!YourTextboxName

If you need to send a PDF, you can do it with Outlook. Here's the code:

http://www.datastrat.com/Code/OutlookEmail.txt
--
Arvin Meyer, MCP, MVPhttp://www.datastrat.comhttp://www.mvps.org/accesshttp://www.accessmvp.com







- Show quoted text -

You can send a PDF using SendObject in Access07. It is one of the
selections in the "Output Format" argument. The problem I am having
is that my control reference isn't working. When I run the macro, it
is literally putting Forms!Customers!Email as the To: address in the
outgoing email. Appreciate any help anyone can offer.
Thanks,
Kelly
 
A

Arvin Meyer [MVP]

You can send a PDF using SendObject in Access07. It is one of the
selections in the "Output Format" argument. The problem I am having
is that my control reference isn't working. When I run the macro, it
is literally putting Forms!Customers!Email as the To: address in the
outgoing email. Appreciate any help anyone can offer.
=================================================

That shouldn't be happening. Post the exact code you are using. Try also
using variables like:

Dim strTo As String
strTo = Me.Email
strSubJect = Me.Subject
strMsg = Me.Message

DoCmd.SendObject acSendReport, "rptReportName, acFormatPDF, strTo, , ,
strSubject, strMsg, False
 
A

ARZU

iletide sunu yazdi said:
Hi, I am trying to set up a macro to open a report (which has a
selection criteria to select one invoice), and then use SendObject to
create a PDF to the customer to whom the invoice belongs. Of course,
their email address is stored in a field in my customers table. Can I
reference this field in the macro for the email TO: field?

Thanks,
Kelly (e-mail address removed); Standridge
 

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

Similar Threads


Top