I was wondering if it would be possible to snapshot an access report
to Outlook, and have fields come in the To: and Cc: fields, and also
the subject field of the email as well. Right now, I am able to click
on a button on an access form, and have it snapshot the report to an
email. Here is the code:
************************************************** **************
Sub cmdSaveRecord_Click()
Dim stDocName As String
Dim stCriteria As String
On Error GoTo Err_cmdSaveRecord_Click
' save the inputed values
Me![txtIdentNumber] = Me![txtIdentNumberIn]
Me![txtPacketSequenceNo] = Me![txtPacketSequenceNoIn]
Me![txtDueDate] = Me![txtDueDateIn]
Me![txtDateRecd] = Me![txtDateRecdIn]
Me![txtDescription] = Me![txtDescriptionIn]
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, ,
acMenuVer70
Me![cmdAddNewRecord].Enabled = True
Me![cmdExit].SetFocus
Me![cmdSaveRecord].Enabled = False
stDocName = "Shop Drawing Routing - Rev"
stCriteria = "([SD_TRACKING_TABLE]![IdentNumber]= " & """" &
SDIdentificationNumber & """)" & " AND
([SD_TRACKING_TABLE]![PacketSequenceNo]= " &
LTrim(Str(SDSequenceNumber)) & ")"
DoCmd.OpenReport stDocName, acPreview, , stCriteria
DoCmd.Maximize
**The following line of code actually takes a snapshot of the **report
and sends it out to Outlook, as an attachment.
DoCmd.SendObject acSendReport, , acFormatSNP, , , , _
"Shop Drawing Transmittal"
Exit_cmdSaveRecord_Click:
Exit Sub
Err_cmdSaveRecord_Click:
MsgBox Err.Description
Resume Exit_cmdSaveRecord_Click
End Sub
************************************************** ***************
In the actual report, there are two fields, one with the Team
Manager's name, represented by the field TeamMgr, and the other for
the Designer, represented by the field Dsgnr. I was wondering if it
would be possibly, while sending out the report to Outlook, to
automatically have those fields, be associated with names in our
Outlook Address list, and have it so the TeamMgr field goes in the To:
field, and the Dsgnr field goes to the Cc: field. There is also a
project number, represented by the field ProjNum, that I would like to
have put in the subject line of the message as well. Any help on this
would be greatly appreciated! Thanks in advance,
Jonathan