Bom dia Amigos
Fiz o codigo abaixo para o envio de email via formulario e abaixo tem o codigo, porem nao esta migrando para o TO: a relacao dos emails, poderiam me auxiliar
Private Sub Comando268_Click()
Dim strPara As String
Dim objOutlook As Object
Dim objMailItem As Object
Dim rsteste As DAO.Recordset
Dim StrSql As String
'Create a Microsoft Outlook object.
Const olMailItem As Integer = 0
Set objOutlook = CreateObject("Outlook.Application")
'Create and open a new contact form for input.
Set objMailItem = objOutlook.CreateItem(olMailItem)
StrSql = "SELECT * FROM TbEquipes"
Set rsteste = CurrentDb.OpenRecordset(StrSql)
RecordSource = StrSql
strPara = rsteste ' aqui esta o erro e nao consigo seguir
objMailItem.To = strPara
objMailItem.Display
'Quit Microsoft Outlook.
Set objMailItem = Nothing
Set objOutlook = Nothing
Exit Sub
StartError:
MsgBox "Error: " & Err & " " & Error
agrade a ajuda
Fiz o codigo abaixo para o envio de email via formulario e abaixo tem o codigo, porem nao esta migrando para o TO: a relacao dos emails, poderiam me auxiliar
Private Sub Comando268_Click()
Dim strPara As String
Dim objOutlook As Object
Dim objMailItem As Object
Dim rsteste As DAO.Recordset
Dim StrSql As String
'Create a Microsoft Outlook object.
Const olMailItem As Integer = 0
Set objOutlook = CreateObject("Outlook.Application")
'Create and open a new contact form for input.
Set objMailItem = objOutlook.CreateItem(olMailItem)
StrSql = "SELECT * FROM TbEquipes"
Set rsteste = CurrentDb.OpenRecordset(StrSql)
RecordSource = StrSql
strPara = rsteste ' aqui esta o erro e nao consigo seguir
objMailItem.To = strPara
objMailItem.Display
'Quit Microsoft Outlook.
Set objMailItem = Nothing
Set objOutlook = Nothing
Exit Sub
StartError:
MsgBox "Error: " & Err & " " & Error
agrade a ajuda