I got this code form an old post on here, and I was wondering how to call this to run. What do I have to do to call/activate/run this function?
Public Function PrintPDFemail2( )
DoCmd.OpenRepor t "rptJobItemStat ", acViewNormal
Dim strEmail As String
Dim strMsg As String
Dim oLook As Object
Dim oMail As Object
Set oLook = CreateObject("O utlook.Applicat ion")
Set oMail = oLook.createite m(0)
With oMail
.to = "someone@email. com"
.body = "Attached is a PDF file for your viewing"
.Subject = "Job Item"
.Attachments.Ad d ("C:\Documen ts and
Settings\ron_m\ Desktop\rptJobI temStat.pdf")
.Send
End With
Set oMail = Nothing
Set oLook = Nothing
End Function
Thanks
Public Function PrintPDFemail2( )
DoCmd.OpenRepor t "rptJobItemStat ", acViewNormal
Dim strEmail As String
Dim strMsg As String
Dim oLook As Object
Dim oMail As Object
Set oLook = CreateObject("O utlook.Applicat ion")
Set oMail = oLook.createite m(0)
With oMail
.to = "someone@email. com"
.body = "Attached is a PDF file for your viewing"
.Subject = "Job Item"
.Attachments.Ad d ("C:\Documen ts and
Settings\ron_m\ Desktop\rptJobI temStat.pdf")
.Send
End With
Set oMail = Nothing
Set oLook = Nothing
End Function
Thanks
Comment