V
Vit
Hi to everybody ;o)
I'm new on this group...
I try to get information (access and vba) of the spool process of the
fax printer (I'm using zetafax server/cliant).
this is the point:
I have to wait untill the spool process il finished.. and after this I
can pass to the zetafax client the adress (fax number en subject...)
I have written the following code, but there is something wrong....
Public Function Wait()
Dim pauseDuration As Single
Dim fileSize As Long
Dim strSpoolFile As String
Dim tmStart As Double
strSpoolFile = Read_registry_Value("HKEY_LOCAL_MACHINE\SYSTEM
\CurrentControlSet\Control\Print\Printers\Zetafax Printer\Port")
Do
DoEvents
fileSize = FileLen(strSpoolFile)
Loop While fileSize = 0
pauseDuration = 2
tmStart = Timer
Do While Timer < tmStart + pauseDuration
DoEvents
Loop
Exit Function
oops:
If Err.Number = 53 Then
Resume Next
End If
MsgBox Err.Description
End Function
Public Function Read_registry_Value(ByVal KeyName As String) As String
On Error GoTo 0
Dim Shell As Object
Dim keyvalue As String
Set Shell = CreateObject("wscript.shell")
On Error Resume Next
keyvalue = Shell.regread(KeyName)
If Err.Number <> 0 Then
MsgBox "Invalid Registry Entry"
End If
Read_registry_Value = keyvalue
End Function
the debug system telll me that there is somenting wrong on the
fileSize = FileLen(strSpoolFile)
it tell me the strSpoolFile is not a valid data.... why????
how can I find the correct spool file?????
thank you very much!!!!
Vt
I'm new on this group...
I try to get information (access and vba) of the spool process of the
fax printer (I'm using zetafax server/cliant).
this is the point:
I have to wait untill the spool process il finished.. and after this I
can pass to the zetafax client the adress (fax number en subject...)
I have written the following code, but there is something wrong....
Public Function Wait()
Dim pauseDuration As Single
Dim fileSize As Long
Dim strSpoolFile As String
Dim tmStart As Double
strSpoolFile = Read_registry_Value("HKEY_LOCAL_MACHINE\SYSTEM
\CurrentControlSet\Control\Print\Printers\Zetafax Printer\Port")
Do
DoEvents
fileSize = FileLen(strSpoolFile)
Loop While fileSize = 0
pauseDuration = 2
tmStart = Timer
Do While Timer < tmStart + pauseDuration
DoEvents
Loop
Exit Function
oops:
If Err.Number = 53 Then
Resume Next
End If
MsgBox Err.Description
End Function
Public Function Read_registry_Value(ByVal KeyName As String) As String
On Error GoTo 0
Dim Shell As Object
Dim keyvalue As String
Set Shell = CreateObject("wscript.shell")
On Error Resume Next
keyvalue = Shell.regread(KeyName)
If Err.Number <> 0 Then
MsgBox "Invalid Registry Entry"
End If
Read_registry_Value = keyvalue
End Function
the debug system telll me that there is somenting wrong on the
fileSize = FileLen(strSpoolFile)
it tell me the strSpoolFile is not a valid data.... why????
how can I find the correct spool file?????
thank you very much!!!!
Vt