Skip to main content

AccessTr.neT


Raporu Pdf Formatında Ekli Mail Olarak Gönderme

Oğuz Türkyılmaz
Oğuz Türkyılmaz
2
1442

Raporu Pdf Formatında Ekli Mail Olarak Gönderme

#3
(15/12/2018, 11:59)ozanakkaya yazdı: Merhaba, eklediğiniz örnekteki kod, tabloya ek olarak eklenen belgenin dizine kaydedilip outlook'a ek olarak ekleme için tasarlanmış. Sizin raporu pdf uzantılı kaydedip outlook'a ek olarak eklemeniz gerekiyor.

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:

Ozan Bey Teşekkür ederim. Sorunsuz çalışıyor.
Access Çekirgesi 
[Resim: img-cray.gif]


Cevapla

Bir hesap oluşturun veya yorum yapmak için giriş yapın

Yorum yapmak için üye olmanız gerekiyor

ya da

Bu Konudaki Yorumlar
Cvp: Raporu Pdf Formatında Ekli Mail Olarak Gönderme - Yazar: Oğuz Türkyılmaz - 16/12/2018, 22:39
Task