Salve,
avrei bisogno di aiuto.
Ho inserito questo codice in una maschera che mi invia un'email con la tecnica CDO Mail e funziona perfettamente
Private Sub cmd_Email_CDO_Click()
On Error GoTo Error_Handler
Dim bMissingSettings As Boolean
'Normally you'd first validate that you have the necessary controls (To, Subject, Msg, ...) filled out before trying to send the e-mail
If DLookup("smtpserverport", "tbl_CDOSettings") = Null Then
bMissingSettings = True
Else
TempVars.Add "smtpserverport", DLookup("smtpserverport", "tbl_CDOSettings")
End If
If DLookup("smtpserver", "tbl_CDOSettings") = Null Then
bMissingSettings = True
Else
TempVars.Add "smtpserver", DLookup("smtpserver", "tbl_CDOSettings")
End If
If DLookup("sendusername", "tbl_CDOSettings") = Null Then
bMissingSettings = True
Else
TempVars.Add "sendusername", DLookup("sendusername", "tbl_CDOSettings")
End If
If DLookup("sendpassword", "tbl_CDOSettings") = Null Then
bMissingSettings = True
Else
TempVars.Add "sendpassword", DLookup("sendpassword", "tbl_CDOSettings")
End If
If bMissingSettings = True Then
MsgBox "Your CDO Mail settings are incomplete.", vbCritical Or vbOKOnly, "Operation Cancelled"
Else
If Me.chk_Edit = True Then
If vbYes = MsgBox("Although you have selected to preview the e-mail prior to sending it, please note that CDO mail does not support this." & _
vbCrLf & vbCrLf & _
"Would you still like to send the e-mail without previewing it?", vbQuestion Or vbYesNo, "No Preview, Send Anyways?") Then
Call SendCDOMail(Me.txt_To, Me.txt_Subject, Me.txt_Msg, Me.txt_BCC)
End If
Else
Call SendCDOMail(Me.txt_To, Me.txt_Subject, Me.txt_Msg, Me.txt_BCC)
End If
End If
Error_Handler_Exit:
On Error Resume Next
Exit Sub
Error_Handler:
MsgBox Err.Number & vbCrLf & Err.Description
Resume Error_Handler_Exit
End Sub
Nel comando Call SendCDOMail(Me.txt_To, Me.txt_Subject, Me.txt_Msg, Me.txt_BCC) non riesco ad utilizzare dei campi esistenti nella maschera cioè vorrei utilizzare il contenuto di un campo esistente al posto di Me.txt_Msg