Kod yapısının
Dim appOutLook As Outlook.Application
Dim MailOutLook As Outlook.MailItem
Dim GDosyaAdi As String
'Dim rsKayit As DAO.Recordset2
'Dim GEk
'Set rsKayit = Me.Recordset
'Set GEk = rsKayit.Fields("EK").Value
GDosyaAdi = Environ("Temp") & "\" & Me.FirmaUnvan & " - " & Me.Kimlik & ".pdf"
If Len(Dir(GDosyaAdi)) > 0 Then
Kill GDosyaAdi
End If
DoCmd.OutputTo acOutputReport, "R_02_VerilenTeklifler", acFormatPDF, GDosyaAdi
Set appOutLook = CreateObject("Outlook.Application")
Set MailOutLook = appOutLook.CreateItem(olMailItem)
With MailOutLook
.to = Me.txtE_Mail
.Subject = "ISSE GROUP Fiyat Teklifi"
'.HTMLBody = Me.mess_text
' GEk.Fields("FileData").SaveToFile Environ("Temp")
.Attachments.Add GDosyaAdi
'.DeleteAfterSubmit = True 'This would let Outlook send th note without storing it in your sent bin
.Send
End With
' DoCmd.Close
'MsgBox MailOutLook.Body
Exit Sub
'email_error:
' MsgBox "An error was encountered." & vbCrLf & "The error message is: " & Err.Description
' Resume Error_out
'Error_out: