Eğer alttaki gibi değiştirirseniz klasörler yoksa kod ekler ve otomatik olur her bilgisayar için.
Private Sub Report_DblClick(Cancel As Integer)
'DoCmd.OutputTo acOutputReport, Me.Name, acFormatPDF, "C:\Users\Hegu\OneDrive\Masaüstü\Emirsan\Teklifler\" & [Forms]![MUSTERILER2]![FIRMAADI].Value & "_" & Format(Date, "dd_mm_yyyy") & ".pdf"
'MsgBox "PDF Aktarýmý Tamamlandý", vbInformation, "Report Exported as PDF"
Dim RptName, FilePath As String
Dim appOutLook As Outlook.Application
Dim MailOutLook As Outlook.MailItem
MailAdr = [Forms]![MUSTERILER2]![MAIL].Value
RptName = [Forms]![MUSTERILER2]![FIRMAADI].Value & "_" & Format(Date, "dd_mm_yyyy") & ".pdf"
FilePath = CreateObject("WScript.Shell").specialfolders("Desktop") & "\Emirsan\"
Dim FilePath2 As String
FilePath2 = FilePath & "\Teklifler\"
If Dir(FilePath, vbDirectory) = "" Then MkDir FilePath
If Dir(FilePath2, vbDirectory) = "" Then MkDir FilePath2
DoCmd.OutputTo acOutputReport, Me.Name, acFormatPDF, FilePath2 & 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 = "[email protected]"
.Subject = "Teklif"
.HTMLBody = "Emirsan Teklif Formu"
.Attachments.Add FilePath2 & RptName
.Send
End With
MsgBox "Mail Gönderildi", vbInformation, "Report Sent as PDF"
End Sub