AFax - device options

"valery_vi" <[email protected]>
Newsgroups gmane.comp.windows.autoit.user
Message-ID <[email protected]>
Hi,

Early I had problems with fax sending but today my fax device is 
working fine (ACorp modem - $20). So I want to automate it's hard job 
by AutoIt.

This is first simple AutoFax script which can connect to my FaxServer 
and show it's options:

; Important note:
; Minimum operating systems Windows XP, Windows Server 2003 

Global $FaxServer, $FaxActivity, $FaxDevices, $FaxDevice
Dim $MsgTitle = 'Fax Sample'

$FaxServer = ObjCreate('FaxComEx.FaxServer')
if Not IsObj($FaxServer) then 
  MsgBox(0,$MsgTitle, 'FaxServer was not created!')
  exit
endif

; Connect to the local fax server. 
$FaxServer.Connect('')
if @Error then 
  MsgBox(0,$MsgTitle, 'FaxServer was not connected!')
  exit
endif
MsgBox(0,$MsgTitle, 'FaxServer connected!')

$FaxActivity = $FaxServer.Activity
if Not IsObj($FaxActivity) then 
  MsgBox(0,$MsgTitle, 'FaxActivity was not created!')
  exit
endif
MsgBox(0,$MsgTitle, 'FaxActivity created!')

;Refresh the activity object
$FaxActivity.Refresh()

;Retrieves a list of fax devices
$FaxDevices = $FaxServer.GetDevices()
if Not IsObj($FaxDevices) then 
  MsgBox(0,$MsgTitle, 'FaxDevices were not obtained!')
  exit
endif

MsgBox(0,$MsgTitle, 'FaxServer has ' & $FaxDevices.Count & ' 
devices..')

$FaxDevice = $FaxDevices.Item(0)
if Not IsObj($FaxDevice) then 
  MsgBox(0,$MsgTitle, 'FaxDevice was not obtained!')
  exit
endif

$Msg = ''
$Msg &= ' CSID: ' & $FaxDevice.CSID & @CrLf 
$Msg &= ' TSID: ' & $FaxDevice.TSID & @CrLf 
$Msg &= ' Description: ' & $FaxDevice.Description & @CrLf 
$Msg &= ' Name: ' & $FaxDevice.DeviceName & @CrLf 
$Msg &= ' Id: ' & $FaxDevice.Id & @CrLf 
$Msg &= ' PoweredOff: ' & $FaxDevice.PoweredOff & @CrLf 
$Msg &= ' ProviderUniqueName: ' & $FaxDevice.ProviderUniqueName & 
@CrLf 
$Msg &= ' ReceiveMode: ' & $FaxDevice.ReceiveMode & @CrLf 
$Msg &= ' SendEnabled: ' & $FaxDevice.SendEnabled & @CrLf 

MsgBox(0,$MsgTitle, 'FaxDevice' & @CrLf & $Msg)

Enjoy,
Valery

PS. Really my goal is to extract TIFF image from Fax device. I would 
like to use this weird method to convert any text documents into 
image form.
:-)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.