Jump to content

Windows FAX Managment


Recommended Posts

Can anybody help me to translate the below code to Autoit

----------------------------

Private Sub Form_Load()

Dim objFaxServer As New FAXCOMEXLib.FaxServer

Dim collFaxIncomingJobs As FAXCOMEXLib.FaxIncomingJobs

Dim objFaxIncomingJob As FAXCOMEXLib.FaxIncomingJob

'Error handling

On Error GoTo Error_Handler

'Connect to the fax server

objFaxServer.Connect("")

'Get the collection of jobs in the incoming queue

collFaxIncomingJobs = objFaxServer.Folders.IncomingQueue.GetJobs

'Display the number of jobs in the collection

MsgBox("There are " & collFaxIncomingJobs.Count & " jobs in the incoming queue.")

Dim n As Long

'Get the job

n = InputBox("Input the item number for which you want information.")

objFaxIncomingJob = collFaxIncomingJobs.Item(n)

'Refresh the job object (job is in process of being received, you

'want current information)

objFaxIncomingJob.Refresh()

'Display the job properties

MsgBox("Available operations: " & objFaxIncomingJob.AvailableOperations & _

vbCrLf & "Caller ID: " & objFaxIncomingJob.CallerId & _

vbCrLf & "CSID: " & objFaxIncomingJob.CSID & _

vbCrLf & "Current page: " & objFaxIncomingJob.CurrentPage & _

vbCrLf & "Device ID: " & objFaxIncomingJob.DeviceId & _

vbCrLf & "Extended status: " & objFaxIncomingJob.ExtendedStatus & _

vbCrLf & "Extended status code : " & objFaxIncomingJob.ExtendedStatusCode & _

vbCrLf & "Job ID: " & objFaxIncomingJob.Id & _

vbCrLf & "Job type: " & objFaxIncomingJob.JobType & _

vbCrLf & "Retries: " & objFaxIncomingJob.Retries & _

vbCrLf & "Routing information: " & objFaxIncomingJob.RoutingInformation & _

vbCrLf & "Size: " & objFaxIncomingJob.Size & _

vbCrLf & "Status: " & objFaxIncomingJob.Status & _

vbCrLf & "Transmission start: " & objFaxIncomingJob.Transmissionstart & _

vbCrLf & "Transmission end: " & objFaxIncomingJob.Transmissionend & _

vbCrLf & "TSID: " & objFaxIncomingJob.TSID)

'Allow user to cancel the selected fax

Dim CancelString As String

CancelString = InputBox("Cancel this fax (Y/N)?")

If CancelString = "Y" Then objFaxIncomingJob.Cancel()

'Allow user to open the selected fax

Dim OpenString As String

OpenString = InputBox("Open this fax (Y/N)?")

If OpenString = "Y" Then

Dim FileName As String

FileName = InputBox("Provide path and name of file for TIFF copy, e.g. c:\MyFax.tiff")

objFaxIncomingJob.CopyTiff(FileName)

'Open the tiff file

Dim A As Object

A = CreateObject("wscript.shell")

A.run(FileName)

End If

Exit Sub

Error_Handler:

'Implement error handling at the end of your subroutine. This

' implementation is for demonstration purposes

MsgBox("Error number: " & Hex(Err.Number) & ", " & Err.Description)

End Sub

------------------------

Basically I'm trying to take the incoming callerid/TSID to autoit..

Link to post
Share on other sites
  • 3 weeks later...

This is a complete stab in the dark, since I don't have that COM object, but I was bored.

It at least comes back with 0 syntax errors.

Local $objFaxServer = ObjCreate("FAXCOMEXLib.FaxServer")
Local $collFaxIncomingJobs = ObjCreate("FAXCOMEXLib.FaxIncomingJobs")
Local $objFaxIncomingJob = ObjCreate("FAXCOMEXLib.FaxIncomingJob")

;Error handling
$oMyError = ObjEvent("AutoIt.Error","MyErrFunc")    

;Connect to the fax server
$objFaxServer.Connect("")

;Get the collection of jobs in the incoming queue
$collFaxIncomingJobs = $objFaxServer.Folders.IncomingQueue.GetJobs

;Display the number of jobs in the collection
MsgBox(0,"Incoming Jobs","There are " & $collFaxIncomingJobs.Count & " jobs in the incoming queue.")

Local $n

;Get the job
$n = InputBox("Enter Item Number","Input the item number for which you want information.")
If $n Then 
    $objFaxIncomingJob = $collFaxIncomingJobs.Item($n)
Else
    Exit
EndIf

;Refresh the job object (job is in process of being received, you
;want current information)
$objFaxIncomingJob.Refresh()

;Display the job properties
MsgBox(0,"Operations","Available operations: " & $objFaxIncomingJob.AvailableOperations & _
@CrLf & "Caller ID: " & $objFaxIncomingJob.CallerId & _
@CrLf & "CSID: " & $objFaxIncomingJob.CSID & _
@CrLf & "Current page: " & $objFaxIncomingJob.CurrentPage & _
@CrLf & "Device ID: " & $objFaxIncomingJob.DeviceId & _
@CrLf & "Extended status: " & $objFaxIncomingJob.ExtendedStatus & _
@CrLf & "Extended status code : " & $objFaxIncomingJob.ExtendedStatusCode & _
@CrLf & "Job ID: " & $objFaxIncomingJob.Id & _
@CrLf & "Job type: " & $objFaxIncomingJob.JobType & _
@CrLf & "Retries: " & $objFaxIncomingJob.Retries & _
@CrLf & "Routing information: " & $objFaxIncomingJob.RoutingInformation & _
@CrLf & "Size: " & $objFaxIncomingJob.Size & _
@CrLf & "Status: " & $objFaxIncomingJob.Status & _
@CrLf & "Transmission start: " & $objFaxIncomingJob.Transmissionstart & _
@CrLf & "Transmission end: " & $objFaxIncomingJob.Transmissionend & _
@CrLf & "TSID: " & $objFaxIncomingJob.TSID)

;Allow user to cancel the selected fax
Local $CancelString
$CancelString = MsgBox(4,"Cancel","Cancel this fax?")
If $CancelString = 6 Then $objFaxIncomingJob.Cancel()

;Allow user to open the selected fax
Local $OpenString
$OpenString = MsgBox(4,"Open","Open this fax?")
If $OpenString = 6 Then
    Local $FileName
    $FileName = InputBox("Enter File","Provide path and name of file for TIFF copy, e.g. c:\MyFax.tiff")
    $objFaxIncomingJob.CopyTiff($FileName)

    ;Open the tiff file
    Local $A
    $A = ObjCreate("wscript.shell")
    $A.run($FileName)
EndIf
Exit

    ;Implement error handling at the end of your subroutine. This 
    ; implementation is for demonstration purposes
    ; This is my custom defined error handler
Func MyErrFunc()

  Msgbox(0,"AutoItCOM Test","We intercepted a COM Error !"      & @CRLF  & @CRLF & _
            "err.description is: "    & @TAB & $oMyError.description    & @CRLF & _
            "err.windescription:"   & @TAB & $oMyError.windescription & @CRLF & _
            "err.number is: "       & @TAB & hex($oMyError.number,8)  & @CRLF & _
            "err.lastdllerror is: "   & @TAB & $oMyError.lastdllerror   & @CRLF & _
            "err.scriptline is: "   & @TAB & $oMyError.scriptline   & @CRLF & _
            "err.source is: "       & @TAB & $oMyError.source       & @CRLF & _
            "err.helpfile is: "     & @TAB & $oMyError.helpfile     & @CRLF & _
            "err.helpcontext is: "    & @TAB & $oMyError.helpcontext _
            )
            
Endfunc
Link to post
Share on other sites
  • 9 years later...
  • Moderators

LarryBradberry,

What makes me think someone else new might just be along in a while with a whole slew of payware links?

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to post
Share on other sites
  • Moderators

LarryBradberry,

I think you are just pushing your preferred software - so go do it somewhere else. Account closed.

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...