I'm trying to send an email using an .oft template from access. I'm new to VB and not sure if this will work but I hope someone can help. I want the email addresses to be in the bcc row, which it gets from the loop, and then opens the template so I can send the email. Here is my code
On Error GoTo Err_List
Dim List1 As String
Dim MaxPerList, CountThisList As Integer
Set dbs = CurrentDb
Set rs = dbs.OpenRecordset("Emails")
MaxPerList = 99
If .RecordCount <> 0 Then
Do While Not rs.EOF
List1 = ""
CountThisList = 0
Do While Not rs.EOF And CountThisList < MaxPerList
List1 = List1 + rs(6) + "; "
CountThisList = CountThisList + 1
List1 = Left(List1, Len(List1) - 2)
Dim myOlApp As Outlook.Application
Dim MyItem As Outlook.MailItem
Set myOlApp = CreateObject("Outlook.Application")
Set MyItem = myOlApp.CreateItemFromTemplate("C:\test.oft")
MyItem.Subject = "test"
MyItem.BCC = List1