AccessUser22
Technical User
I have my database set up to send outlook emails with the click of a button. However, I now need to attach an access report to these emails. Is there any way to make an attachment without having to first run the report and save it externally and then point to it through the code?
The basic email code I've been using is as follows:
Private Sub cmdSendtoCoord_Click()
Dim otlApp As Outlook.Application
Dim otlItem As Outlook.MailItem
Dim strRecip As String
Dim strRecipCC As String
Set otlApp = New Outlook.Application
Set otlItem = otlApp.CreateItem(olMailItem)
If (IsNull(Forms!frmpo!cboCoordID.Column(6))) Then
MsgBox "Please assign a coordinator and confirm" & vbCrLf & _
"the coordinator's email address" & vbCrLf & _
"prior to attempting email notification."
Else
strRecip = Forms!frmpo!cboCoordID.Column(6)
strRecipCC = ""
otlItem.To = strRecip
otlItem.CC = strRecipCC
otlItem.Subject = "Report for ID #" & Me.IDNo & " - Please Expedite Request"
otlItem.Body = "Attached is the Report for the above referenced ID Number." & vbCrLf & vbCrLf & _
"Please return signed to IT/Operations via fax."
otlItem.Display
End If
Set otlItem = Nothing
Set otlApp = Nothing
End Sub
Any info would be appreciated. Thanks![[hourglass] [hourglass] [hourglass]](/data/assets/smilies/hourglass.gif)
The basic email code I've been using is as follows:
Private Sub cmdSendtoCoord_Click()
Dim otlApp As Outlook.Application
Dim otlItem As Outlook.MailItem
Dim strRecip As String
Dim strRecipCC As String
Set otlApp = New Outlook.Application
Set otlItem = otlApp.CreateItem(olMailItem)
If (IsNull(Forms!frmpo!cboCoordID.Column(6))) Then
MsgBox "Please assign a coordinator and confirm" & vbCrLf & _
"the coordinator's email address" & vbCrLf & _
"prior to attempting email notification."
Else
strRecip = Forms!frmpo!cboCoordID.Column(6)
strRecipCC = ""
otlItem.To = strRecip
otlItem.CC = strRecipCC
otlItem.Subject = "Report for ID #" & Me.IDNo & " - Please Expedite Request"
otlItem.Body = "Attached is the Report for the above referenced ID Number." & vbCrLf & vbCrLf & _
"Please return signed to IT/Operations via fax."
otlItem.Display
End If
Set otlItem = Nothing
Set otlApp = Nothing
End Sub
Any info would be appreciated. Thanks
![[hourglass] [hourglass] [hourglass]](/data/assets/smilies/hourglass.gif)