Skip to content

Instantly share code, notes, and snippets.

View toddring's full-sized avatar

Todd Ring toddring

View GitHub Profile
@toddring
toddring / send mail with outlook
Created September 10, 2014 19:07
Access - Send mail using Outlook
Public Function SendEMail(Attachment1 As String, Attachment2 As String, DatePart As String)
'Dim db As DAO.Database
'Dim MailList As DAO.Recordset
Dim MyOutlook As Outlook.Application
Dim MyMail As Outlook.MailItem
Dim Subjectline As String
Dim MyBodyText As String
Dim MyEmailAddress As String
@toddring
toddring / Print to PDF
Created September 10, 2014 19:06
Access - Print to PDF
Function PrintToPDF(SrcFile As String, DestPath As String, DestFile As String, ShowPdf As Boolean)
On Error GoTo PrintToPDF_Err
'ScrFile = The report Name to output as PDF
'DestPath = Destination path for PDF file
'DestFile = File name for the PDF file being created without the file extension
'Showpdf = launch acrobat and display the PDF file or not
DoCmd.OutputTo acOutputReport, SrcFile, "PDFFormat(*.pdf)", DestPath & DestFile & ".pdf", ShowPdf, "", 0, acExportQualityPrint
<table>
<caption>
This table shows the matches of the <acroynm title="Major League Baseball">MLB</acronym>. It contains the following headings, Date of game, Visiting team, Home team, Game Time.
</caption>
<thead>
<tr>
<th>Date</th>
<th>Visiting Team</th>
<th>Home Team</th>
<th>Game Time</th>
@toddring
toddring / Ranges
Created April 12, 2012 20:08
Excel - Find Ranges
Public Function LastRow()
LastRow = Cells.Find(What:="*", After:=Range("A1"), LookIn:=xlValues, LookAt:= _
xlPart, SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row
End Function
Public Function FirstRow()
FirstRow = Cells.Find(What:="*", After:=Range("IV65536"), LookIn:=xlValues, LookAt:= _
xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext).Row
End Function