Private Sub Report_DblClick(Cancel As Integer)
Dim RptName, FilePath As String
Dim appOutLook As Outlook.Application
Dim MailOutLook As Outlook.MailItem
RptName = [Forms]![MUSTERILER2]![FIRMAADI].Value & "_" & Format(Date, "dd_mm_yyyy") & ".pdf"
FilePath = "C:\Users\Hegu\OneDrive\Masaüstü\Emirsan\Teklifler\"
DoCmd.OutputTo acOutputReport, Me.Name, acFormatPDF, FilePath & RptName
MsgBox "PDF Aktarımı Tamamlandı", vbInformation, "Report Exported as PDF"
If Len(Dir(RptName)) > 0 Then
Kill RptName
End If
Set appOutLook = CreateObject("Outlook.Application")
Set MailOutLook = appOutLook.CreateItem(olMailItem)
With MailOutLook
.To = "BURAYA ALICININ E-MAIL ADRESİ YAZILACAK"
.Subject = "BURAYA KONU YAZILACAK"
.HTMLBody = "E-MAIL METNİNİZ YAZILACAK"
.Attachments.Add FilePath & RptName
.Send
End With
MsgBox "Mail Gönderildi", vbInformation, "Report Sent as PDF"
End Sub
Kodu aşağıdaki ile değiştirip dener misiniz lütfen?