23-11-13, 06:17 AM
السلام عليكم
- هذا السؤال تم طرحه في المنتدى القديم ,و الذي رابطه في أعلى صفحة هذا المنتدى , هذا هو الكود لعمل ذلك :
- تحياتي .
- هذا السؤال تم طرحه في المنتدى القديم ,و الذي رابطه في أعلى صفحة هذا المنتدى , هذا هو الكود لعمل ذلك :
كود :
Private Declare Function SetDefaultPrinter Lib "winspool.drv" Alias "SetDefaultPrinterA" (ByVal pszPrinter As String) As Long
Private Sub Command1_Click()
Dim Prt As Printer
Dim Def_PrinterName As String
'تخزين إسم الطابعة الحالية في هذا المتغير
Def_PrinterName = Printer.DeviceName
DoEvents
Set DataReport1.DataSource = Adodc1
DoEvents
For Each Prt In Printers
If Prt.DeviceName = "EPSON LQ-300+II ESC/P2" Or Prt.DeviceName = "Canon MF4320-4350" Then
SetDefaultPrinter Prt.DeviceName
DoEvents
DataReport1.PrintReport False
DoEvents
End If
Next
'إستعادة الطابعة الإفتراضية
SetDefaultPrinter Def_PrinterName
DoEvents
End Sub- تحياتي .
كود :
For each Breathe in MyLife
Breathe.Say " سبحان الله والحمد لله ولا إله إلا الله والله أكبر أستغر الله العظيم وأتوب إليه"
Next
