Expand|Select|Wrap|Line Numbers
- Private Sub BCCMail_Click()
- On Error GoTo Err_BCCMail_Click
- Dim rst As DAO.Recordset
- Dim MyOutlook As New Outlook.Application
- Dim MyMail As Outlook.MailItem
- Dim StrBCC As String
- Dim stDocName As String
- stDocName = "QEmail"
- Set rst = CurrentDb.OpenRecordset(stDocName, dbOpenForwardOnly)
- With rst
- Do Until .EOF
- StrBCC = StrBCC & ![E-mail] & ";"
- .MoveNext
- Loop
- .Close
- End With
- StrBCC = Left(StrBCC, Len(StrBCC) - 1)
- Set MyOutlook = New Outlook.Application
- Set MyMail = MyOutlook.CreateItem(olMailItem)
- MyMail.BCC = StrBCC
- MyMail.Display
- Set MyOutlook = Nothing
- Set rst = Nothing
- Exit_BCCMail_Click:
- Exit Sub
- Err_BCCMail_Click:
- MsgBox Err.Description
- Resume Exit_BCCMail_Click
- End Sub