Shyju Posted March 2, 2011 Share Posted March 2, 2011 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 comment Share on other sites More sharing options...
bwochinski Posted March 19, 2011 Share Posted March 19, 2011 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. expandcollapse popupLocal $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 comment Share on other sites More sharing options...
LarryBradberry Posted April 19, 2020 Share Posted April 19, 2020 I'm going to use fax service for the first time. I'm even not sure which service is better and reliable. If you know more please let me know. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted April 19, 2020 Moderators Share Posted April 19, 2020 LarryBradberry, What makes me think someone else new might just be along in a while with a whole slew of payware links? M23 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 columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
LarryBradberry Posted April 22, 2020 Share Posted April 22, 2020 (edited) Thank you so much for your reply @Melba23. Actually I was looking for some kind of help here and there. Anyways, I found <snip> which is suitable for Windows 10. I would like to try it. What do you think? Edited April 22, 2020 by Melba23 Link removed Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted April 22, 2020 Moderators Share Posted April 22, 2020 LarryBradberry, I think you are just pushing your preferred software - so go do it somewhere else. Account closed. M23 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 columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now