Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Send Object Command

Status
Not open for further replies.

EdFleeson

Technical User
Mar 12, 2003
14
0
0
US
I am building a macro that will email reports directly to employees using the Send Object command. I have about 4 different documents that I could email at any point in time. The plan is to send each one on its own if the report is selected (potentially 4 emails for each person. Rather then maintaining email address on each Send Object document command, I want to build a email table within Access that has a reference number and the email address for each user. This way I don't have to update the addresses in each report, only the reference table. I'm trying to find a way to have the "TO" field in the Send Object command reference this table and fill in the email address. Is there a way to do this?
 
Yes,

Function Mailit()
Dim Repname As String
Dim MapiMessage As Variant
Dim MapiRecipient As Variant
Dim MapiAttachment As Variant
Dim db As Database
Dim Mailist As Recordset
Dim CurAdd As String
Dim mailto As String
Dim fldAddress As String
Set db = CurrentDb
Set Mailist = db.OpenRecordset("Email Contacts")

Mailist.MoveFirst

Do Until Mailist.EOF
CurAdd = Mailist!Address & ";" & mailto
mailto = CurAdd
Mailist.MoveNext
Loop
Repname = "Special Report"


DoCmd.SendObject acSendReport, Repname, acFormatTXT, mailto, , , "Special Alert", , False


End Function
 
Thanks Joe

I'm not real good with Code yet so I'm trying to sort through this. One thing that I may not have been clear about and want to make sure this will still work is, the reports I want to send out are specific to each person/location I want to send the report to. Example: Report 1 can go to 3 different locations but the contect(data) for each location is different (basically their month stat numbers). I have a form that you can select the sites you want to email to (using a toggle button). If the toggle is on, then this should trigger to send the report to the site that is specifi to that site (sound complex?)
 
I have a similar issue and want to clarify. I need to send a form letter (Report) to each registered person in an upcoming class. I have a query that the report is based on and also contains the email address for each person. Can I use the SendObject action? How do I reference the email address field for the "To:" property?

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top