اذهب الي المحتوي
أوفيسنا
بحث مخصص من جوجل فى أوفيسنا
Custom Search

المساعدة في كود


MO87

الردود الموصى بها

السلام عليكم

انا اشتغلت علي كود ارسال الاميل مع المرفقات والكود شغال يفتح الاوتلوك ومعه المرفق ولكن التقرير لا يتم ارسالة

الرجاء المساعدة في فتح الاوتلوك علي المرفق والتعميم سويا

وشكرا مقدما لحضرتكم

On Error Resume Next
Dim OutlookApp As Outlook.Application
    Dim OutlookMail As Outlook.MailItem
    Dim StrTo As String
    Dim StrSubject As String
    Dim StrBody As String
    Dim StrAttachment As String
    Dim fileName As String
Dim db As DAO.Database, rs As DAO.Recordset
fileName = Application.CurrentProject.Path & "\reportNotice.pdf"
    DoCmd.OutputTo acReport, "reportNotice", acFormatPDF, fileName, False

    Set OutlookApp = CreateObject("Outlook.Application")
    Set OutlookMail = OutlookApp.CreateItem(olMailItem)
    StrTo = ""
    StrSubject = "reportNotice"
    StrBody = "Please find the attached report."
    StrAttachment = Me.Imagepath.Value

    With OutlookMail
        .To = StrTo
        .subject = StrSubject
        .Body = StrBody
        .Attachments.Add StrAttachment
        .Display
        .oMail.Send

    End With

    Set OutlookMail = Nothing
    Set OutlookApp = Nothing
         end sub

 

تم تعديل بواسطه jjafferr
لتنسيق الكود: استعمل <> القائمة ، ووضع الكود في نافذته
رابط هذا التعليق
شارك

تم تعديل الكود والان يجلب المرفق والتقرير معا في الاوت لوك الان احتاج ان يرسل تقرير نفس الحقل اللي بيساوي id

Dim OutApp As Object
Dim OutMail As Object
Dim strbody As String
Dim strto As String
Dim strsubject As String
Dim strattachments As String
strto = ""
strsubject = ""
strbody = ""
strattachments = Me.Imagepath.Value

Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
    
With OutMail
    .To = strto
    .subject = strsubject
    .Body = strbody
    .Attachments.Add CurrentProject.Path & "\reportnotice.pdf"
    .Attachments.Add strattachments
    .Display
End With

Set OutMail = Nothing
Set OutApp = Nothing

 

رابط هذا التعليق
شارك

السلام عليكم اخر ما توصلت اليه اني اقوم بطباعة التقرير اولا في نفس مسار قاعدة البيانات وبعدها اقوم بارسال الاوتلوك وبعدها القود يعمل ياخذ التقرير + المرفقات

احتاج ان العملية تتم مباشرة من نفس زر ارسال اوتلوك بحيث يطبع التقرير يساوي id نفس السجل + المرفق

الرجاء من السادة الخبراء المساعدة

test1.rar

رابط هذا التعليق
شارك

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

زائر
اضف رد علي هذا الموضوع....

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • تصفح هذا الموضوع مؤخراً   0 اعضاء متواجدين الان

    • لايوجد اعضاء مسجلون يتصفحون هذه الصفحه
×
×
  • اضف...

Important Information