With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.
Option Compare Database Option Explicit Sub EmailBookings() Dim OutApp As Object Dim OutMail As Object Dim strbody As String Dim SigString As String Dim Signature As String Dim Bkinglist As String Bkinglist = Environ("USERPROFILE") & "\My Documents\test.pdf" Set OutApp = CreateObject("Outlook.Application") Set OutMail = OutApp.CreateItem(0) strbody = "<B>Hi,</B><br>" & _ "Please review the attached PDF booking list.<br>" & _ "Let me know if you have any queries.<br>" & _ "<br><br><B>Thank you</B>" SigString = Environ("appdata") & _ "\Microsoft\Signatures\Personal.htm" If Dir(SigString) <> "" Then Signature = GetBoiler(SigString) Else Signature = "" End If On Error Resume Next With OutMail .To = "firstname.lastname@example.org" .CC = "" .BCC = "" .Subject = "Booking List" .HTMLBody = strbody & "<br>" & Signature .Attachments.Add Bkinglist .Display ' .Send End With On Error GoTo 0 Set OutMail = Nothing Set OutApp = Nothing End Sub Function GetBoiler(ByVal sFile As String) As String 'Dick Kusleika Dim fso As Object Dim ts As Object Set fso = CreateObject("Scripting.FileSystemObject") Set ts = fso.GetFile(sFile).OpenAsTextStream(1, -2) GetBoiler = ts.readall ts.Close End Function
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
|MS Access VBA Suggestions For Doing A Procedure Since the Last Procedure Was Run (Food For Thought)||4||65|
|Access Form - Button Format Issue||13||50|
|Speed up Select Top n... Query||9||37|
|Close gap between sub forms on a main form||5||28|
Join the community of 500,000 technology professionals and ask your questions.