03-05-15, 12:50 PM
(آخر تعديل لهذه المشاركة : 03-05-15, 12:51 PM {2} بواسطة Ashraf Elafify.)
السادة الزملاء الافاضل
السلام عليكم ورحمة الله وبركاته .
قمت بعمل برنامج للشركة التى أعمل بها و هو يعمل جيداً و لله الحمد، ويقوم البرنامج بارسال ايميل عند تغيير البيانات او عند الموافقه على طلب ما من الرئيس المسئول كما فى الكود التالى
ولكن طلب منى مديرى ارسال هذا اليميل بتنسيق مثل الجدول كما فى الصورة المرفقة ؟
ولكن بحثت كثيراً على جوجل و كثير من المواقع ولكن لم أجد ضالتى بها. فهل اجد أحد منكم يساعدنى او يقوم بالتعديل بالكود السابق الذكر.
بارك الله فيكم وفى الجميع.
السلام عليكم ورحمة الله وبركاته .
قمت بعمل برنامج للشركة التى أعمل بها و هو يعمل جيداً و لله الحمد، ويقوم البرنامج بارسال ايميل عند تغيير البيانات او عند الموافقه على طلب ما من الرئيس المسئول كما فى الكود التالى
كود :
With Contacts
.Data1.RecordSource = " select * from Contacts where UnitNames like '" & TdepartmentNameDB.Text & "*" & "'"
.Data1.Refresh
TDepartment.Text = .DBGrid1.Columns(1).Text
TUnitNames.Text = .DBGrid1.Columns(2).Text
TIssuedName.Text = .DBGrid1.Columns(3).Text
TIssuedEmail.Text = .DBGrid1.Columns(4).Text
TDelegationTo.Text = .DBGrid1.Columns(11).Text
TAdministration.Text = .DBGrid1.Columns(24).Text
TDelegationToName.Text = .DBGrid1.Columns(11).Text
IssuedDelegationName.Text = .DBGrid1.Columns(5).Text
IssuedDelegationEmail.Text = .DBGrid1.Columns(6).Text
MechanicalSection.Text = .DBGrid1.Columns(13).Text
ElectricalSection.Text = .DBGrid1.Columns(14).Text
WeldingSection.Text = .DBGrid1.Columns(15).Text
VehiclesSection.Text = .DBGrid1.Columns(16).Text
PM2Names.Text = .DBGrid1.Columns(25).Text
ProdPM2.Text = .DBGrid1.Columns(26).Text
PM3Names.Text = .DBGrid1.Columns(27).Text
ProdPM3.Text = .DBGrid1.Columns(28).Text
PM4Names.Text = .DBGrid1.Columns(29).Text
ProdPM4.Text = .DBGrid1.Columns(30).Text
DeInkingName.Text = .DBGrid1.Columns(31).Text
ProdDeInking.Text = .DBGrid1.Columns(32).Text
GeneralName.Text = .DBGrid1.Columns(33).Text
ProdGeneral.Text = .DBGrid1.Columns(34).Text
End With
Text24.Text = ""
On Error Resume Next
Dim linecount As Long
If TDepartment.Text = "Production" Then
If TLine = "PM2" Or TLine.Text = "Winder2A" Or TLine.Text = "Winder2B" Then
Text24.Text = " Dear Mr. " & PM2Names.Text & " " & " , " & " " & IssuedDelegationName.Text & ""
End If
If TLine.Text = "PM3" Or TLine.Text = "Winder3" Then
Text24.Text = " Dear Mr. " & PM3Names.Text & " " & " , " & " " & IssuedDelegationName.Text & ""
End If
If TLine.Text = "General" Or TLine.Text = "C-PM2/PM3/PM4" Then
Text24.Text = " Dear Mr. " & GeneralName.Text & " " & " , " & " " & IssuedDelegationName.Text & ""
End If
Text24.Text = " " & Text24.Text & vbNewLine & ""
Text24.Text = " " & Text24.Text & vbNewLine & " " & "Kindly Below is RRS Issued By Your Department, And Maintenance Department Receive it, By : " & Text19.Text & " , And Now Task In Planning "
Text24.Text = " " & Text24.Text & vbNewLine & " - " & "RRS # " & TRRS.Text & " " ' With Status : " & TMaintenanceSatus.Text & " "
Text24.Text = " " & Text24.Text & vbNewLine & " - " & "Description : " & TActionTaken.Text & ""
Text24.Text = " " & Text24.Text & vbNewLine & " - " & "Maintenance Section : " & Combo8.Text & " - " & " Shift : " & Combo1.Text & " "
Text24.Text = " " & Text24.Text & vbNewLine & " - " & "Receive Time : " & MB2.Text & " " ' - " & " Shift : " & TShift.Text & " "
Text24.Text = " " & Text24.Text & vbNewLine & " - " & "Receive Comment : " & Text6.Text & " - " & " and It's Issue Task # : " & Text21.Text & " - @ " & MB2.Text & ""
Text24.Text = " " & Text24.Text & vbNewLine & ""
Text24.Text = " " & Text24.Text & vbNewLine & " This Message Was Sent Automatically by Maintenance System Programs, Don't Reply This Message"
Text24.Text = " " & Text24.Text & vbNewLine & ""
Text24.Text = " " & Text24.Text & vbNewLine & "Powered By Maintenance System Program"
Text24.Text = " " & Text24.Text & vbNewLine & " ------------------------------------------------------- "
Else
Text24.Text = " Dear Mr. " & TIssuedName.Text & " " & " , " & " " & IssuedDelegationName.Text & ""
Text24.Text = " " & Text24.Text & vbNewLine & ""
Text24.Text = " " & Text24.Text & vbNewLine & " " & "Kindly Below is RRS Issued By Your Department, And Maintenance Department Receive it, By : " & Text19.Text & " , And Now Task In Planning "
Text24.Text = " " & Text24.Text & vbNewLine & " - " & "RRS # " & TRRS.Text & " " ' With Status : " & TMaintenanceSatus.Text & " "
Text24.Text = " " & Text24.Text & vbNewLine & " - " & "Description : " & TActionTaken.Text & ""
Text24.Text = " " & Text24.Text & vbNewLine & " - " & "Maintenance Section : " & Combo8.Text & " - " & " Shift : " & Combo1.Text & " "
Text24.Text = " " & Text24.Text & vbNewLine & " - " & "Receive Time : " & MB2.Text & " " ' - " & " Shift : " & TShift.Text & " "
Text24.Text = " " & Text24.Text & vbNewLine & " - " & "Receive Comment : " & Text6.Text & " - " & " and It's Issue Task # : " & Text21.Text & " @ " & MB2.Text & ""
Text24.Text = " " & Text24.Text & vbNewLine & ""
Text24.Text = " " & Text24.Text & vbNewLine & " This Message Was Sent Automatically by Maintenance System Programs, Don't Reply This Message"
Text24.Text = " " & Text24.Text & vbNewLine & ""
Text24.Text = " " & Text24.Text & vbNewLine & "Powered By Maintenance System Program"
Text24.Text = " " & Text24.Text & vbNewLine & " ------------------------------------------------------- "
End If
Dim objOutlook As Object
Dim objOutlookMsg As Object
Set objOutlook = CreateObject("Outlook.Application")
Set objOutlookMsg = objOutlook.CreateItem(0)
With objOutlookMsg
If TDepartment.Text = "Production" Then
If TLine.Text = "PM2" Or TLine.Text = "Winder2A" Or TLine.Text = "Winder2B" Then
.To = ProdPM2.Text
End If
If TLine.Text = "PM3" Or TLine.Text = "Winder3" Then
.To = ProdPM3.Text
End If
If TLine.Text = "General" Or TLine.Text = "C-PM2/PM3/PM4" Then
.To = GeneralName.Text
End If
If Combo8.Text = "Mechanical" Then
.Cc = MechanicalSection.Text
End If
If Combo8.Text = "Electrical" Then
.Cc = ElectricalSection.Text
End If
If Combo8.Text = "Welding" Then
.Cc = WeldingSection.Text
End If
If Combo8.Text = "Vehicles" Then
.Cc = VehiclesSection.Text
End If
.Subject = " RRS # " & TRRS.Text & " Now Receive By " & Text19.Text & " - and It's Issue Task # : " & Text21.Text & " - @ " & MB2.Text & " "
.Body = Text24.Text
.Send 'Let´s go!
Set objOutlookMsg = Nothing
Set objOutlook = Nothing
Else
.To = TIssuedEmail.Text
If TSection.Text = "Mechanical" Then
.Cc = MechanicalSection.Text
End If
If TSection.Text = "Electrical" Then
.Cc = ElectricalSection.Text
End If
If TSection.Text = "Welding" Then
.Cc = WeldingSection.Text
End If
If TSection.Text = "Vehicles" Then
.Cc = VehiclesSection.Text
End If
.Subject = " RRS # " & TRRS.Text & " Now Receive By " & Text19.Text & " - and It's Issue Task # : " & Text21.Text & " - @ " & MB2.Text & " "
.Body = Text24.Text
.Send 'Let´s go!
Set objOutlookMsg = Nothing
Set objOutlook = Nothing
End If
End With
Exit Sub
End Sub
thanks a lot
ولكن طلب منى مديرى ارسال هذا اليميل بتنسيق مثل الجدول كما فى الصورة المرفقة ؟
ولكن بحثت كثيراً على جوجل و كثير من المواقع ولكن لم أجد ضالتى بها. فهل اجد أحد منكم يساعدنى او يقوم بالتعديل بالكود السابق الذكر.
بارك الله فيكم وفى الجميع.
لا اله الا انت سبحانك انى كنت من الظالمين.
اللهم انك عفو كريم حليم تحب العفو فاعفوا عنا.
اللّهُمَّ اغْفِرْ لِي وَلِوالِدَيَّ وَارْحَمْهُما كَما رَبَّيانِي صَغِيراً، اللَّهُمَّ اجْزِهِما بِالاِحْسانِ إِحْسانا وَبِالسَّيِّئاتِ غُفْرانا، اللَّهُمَّ اغْفِرْ لِلْمُؤْمِنينَ وَالمُؤْمِناتِ الاَحْياءِ مِنْهُمْ وَالاَمْواتِ.
سبحان الله والحمدلله ولا إله إلا الله والله أكبر زنه عرشك ومداد كلماتك ورضاء نفسك وكما ينبغى لجلال شأنك وعظيم سلطانك وعدد ما كان وعدد ما سيكون وعدد الحركات و السكون وعدد ما نعلم وعدد مالانعلم وعدد كل شيئ احصيته بعلمك يا كريم
اللهم انك عفو كريم حليم تحب العفو فاعفوا عنا.
اللّهُمَّ اغْفِرْ لِي وَلِوالِدَيَّ وَارْحَمْهُما كَما رَبَّيانِي صَغِيراً، اللَّهُمَّ اجْزِهِما بِالاِحْسانِ إِحْسانا وَبِالسَّيِّئاتِ غُفْرانا، اللَّهُمَّ اغْفِرْ لِلْمُؤْمِنينَ وَالمُؤْمِناتِ الاَحْياءِ مِنْهُمْ وَالاَمْواتِ.
سبحان الله والحمدلله ولا إله إلا الله والله أكبر زنه عرشك ومداد كلماتك ورضاء نفسك وكما ينبغى لجلال شأنك وعظيم سلطانك وعدد ما كان وعدد ما سيكون وعدد الحركات و السكون وعدد ما نعلم وعدد مالانعلم وعدد كل شيئ احصيته بعلمك يا كريم