MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.
Private Sub mailemailreport_Click() Dim rst As DAO.Recordset Dim strDistList As String Set rst = CurrentDb.OpenRecordset("Seniors Club") Do While Not rst.EOF strDistList = strDistList & rst!Email & ";" rst.MoveNext Loop If MsgBox("Print Email distribution list to file?", vbYesNo, "Print?") = vbYes Then Dim lFile As Long '/get the next available File handle lFile = FreeFileHandle '/delete the file if it exists If Dir(CurrentProject.Path & "\EmailList.txt") <> "" Then Kill CurrentProject.Path & "\EmailList.txt" '/Now open the file Open CurrentProject.Path & "\EmailList.txt" For Output As #lFile '/write to that file Print #lFile, strDistList '/now close the file Close #lFile Else strDistList = Left(strDistList, Len(strDistList) - 1) Me.Text46 = strDistList End If rst.Close Set rst = Nothing End Sub
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
|How to set correct rule in Outlook 2013/2016||1||27|
|VBA how to delete all objects regardless of its type from all worksheets in workbook||5||23|
|VBA to toggle change the excel table structured reference to explicit cell references||3||17|
|Inserting records in Access database using Excel VBA||4||14|
Join the community of 500,000 technology professionals and ask your questions.