Predmet:Re: Poruka o završetku printanja, dali može?
Evo ti kod za printer. Odnosno za citanje instalisanih printera.
Sada moras reci kako ces dalje.
Dali da odredis jedan printer ili default printer koji ces provjeravati.
Ovo ide na vrh modula.
PreuzmiIzvorni kôd (Visual Basic):Declare Function aht_apiGetProfileSection Lib "kernel32" Alias "GetProfileSectionA" (ByVal lpAppName As String, ByVal lpReturnedString As String, ByVal nSize As Long) As Long
Declare Function aht_apiWriteProfileString Lib "kernel32" Alias "WriteProfileStringA" (ByVal strAppName As String, ByVal strKeyName As String, ByVal strValue As String) As Integer
Const MAX_VEL = 255
Const MAX_SEK = 2048
PreuzmiIzvorni kôd (Visual Basic):Function UpisST()
Dim Db As Database
Dim SQL As String
Dim ST As Integer, a As Integer, B As Integer
Dim STP As String, Diostr1 As String, Diostr2 As String
Dim Rs As Recordset
Dim NazivS As String, DrN As String, NPort As String
Set Db = CurrentDb()
SQL = "DELETE * FROM Stampaci;"
DoCmd.RunSQL (SQL)
a = 1
SQL = "SELECT * FROM Stampaci;"
Set Rs = Db.OpenRecordset(SQL)
STP = Space(MAX_VEL)
ST = aht_apiGetProfileSection("DEVICES", STP, MAX_SEK)
START:
Diostr1 = DioStr(a, STP, Chr(0), 0)
Diostr1 = DioP(Diostr1)
If Diostr1 = "" Then
GoTo Kraj
End If
Rs.AddNew
For B = 1 To 3
Diostr2 = DioStr(B, Diostr1, ",", 1)
Select Case B
Case 1
NazivS = Trim(Diostr2)
Case 2
DrN = Trim(Diostr2)
Case 3
NPort = Trim(Diostr2)
End Select
Next B
Rs.Fields(0) = a
Rs.Fields(1) = Trim(NazivS)
Rs.Fields(2) = DrN
Rs.Fields(3) = NPort
Rs.Update
'Forms![F]![T] = NazivS
B = 1
a = a + 1
GoTo START
Kraj:
Rs.Close
Set Db = Nothing
End Function
Podrska samo putem foruma, jer samo tako i ostali imaju koristi od toga.
Ovaj post je ureden
1
puta. Posljednja izmjena 09.12.2010 20:06 od strane zxz.