FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Sending Fax with Microsoft Fax Service
Posts: 28
Joined: Mon Apr 27, 2009 03:37 PM
Sending Fax with Microsoft Fax Service
Posted: Tue Apr 28, 2009 12:19 PM
Hi,
I am trying to automate sending a fax using the fxscomex.dll. and the following code but i get the error MEMBERNOTFOUND: CONNECTEDSUBMIT. Is there a FiveWin equivalent of #import "fxscomex.dll" that I should be using?

Code (fw): Select all Collapse
   oFaxServer  := CREATEOBJECT( "FaxComEx.FaxServer" )   
   oFaxDoc := CREATEOBJECT( "FaxComEx.FaxDocument" )

  oFaxServer :Connect( "fax" )
    
    oFaxDoc:Body = "c:\gary\sql.txt"
    oFaxDoc:DocumentName = "Fax test"
    oFaxDoc:Recipients:Add( "01865847491" )

    cJobID=oFaxDoc:ConnectedSubmit( oFaxServer  )
    oFaxServer :Disconnect()


Thanks
Gary
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Sending Fax with Microsoft Fax Service
Posted: Tue Apr 28, 2009 02:56 PM
This is a working sample:

Code (fw): Select all Collapse
FUNCTION MAIN()

    LOCAL oFax := CREATEOBJECT( "FaxServer.FaxServer" )

    LOCAL oDoc

    oFax:Connect( "COM1" )

    oDoc = oFax:CreateDocument( "E:\XHARBOUR\FAX.TXT" )

    oDoc:FaxNumber = "0639728261"

    oDoc:FileName = "E:\XHARBOUR\FAX.TXT"

    oDoc:Send()

    oDoc:Disconnect()

    RETURN NIL


EMG
Posts: 28
Joined: Mon Apr 27, 2009 03:37 PM
Re: Sending Fax with Microsoft Fax Service
Posted: Wed Apr 29, 2009 08:18 AM

Hi,

Thanks, just tried that but unfortunately get the error - MEMBERNOTFOUND: SEND. Looking through other coding examples it seems I may have to reference Microsoft Fax Service Extended COM Type Library. How do I go about doing that in fiveWin?

Regards

Gary

Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Sending Fax with Microsoft Fax Service
Posted: Wed Apr 29, 2009 09:36 AM
Try this, works fine here:

Code (fw): Select all Collapse
FUNCTION MAIN( cTel )

    LOCAL oFax := CREATEOBJECT( "FaxComEx.FaxServer" )

    LOCAL oDoc := CREATEOBJECT( "FaxComEx.FaxDocument" )

    IF EMPTY( cTel ); cTel = "0639728261"; ENDIF

    oFax:Connect( "" )

    oDoc:Body = CURDRIVE() + ":\" + CURDIR() + "\TEST.DOC"

    oDoc:DocumentName = "Fax test"

    oDoc:Recipients:Add( cTel )

    oDoc:Recipients( 0 ):Name = "Enrico Maria Giordano"

    oDoc:ConnectedSubmit( oFax )

    oFax:Disconnect()

    RETURN NIL


EMG
Posts: 28
Joined: Mon Apr 27, 2009 03:37 PM
Re: Sending Fax with Microsoft Fax Service
Posted: Wed Apr 29, 2009 10:13 AM

Hi,

Tried new code, now back to original error - MEMBERNOTFOUND: CONNECTEDSUBMIT.

Gary

Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Sending Fax with Microsoft Fax Service
Posted: Wed Apr 29, 2009 10:17 AM

Did you install fax support in Windows? I forgot to mention that I'm using XP.

EMG

Posts: 28
Joined: Mon Apr 27, 2009 03:37 PM
Re: Sending Fax with Microsoft Fax Service
Posted: Wed Apr 29, 2009 10:30 AM

Hi,

Am using XP SP3. Have checked and I do have fax services installed in windows components.

If I send a print to fax from a document in word it works fine, and can monitor with fax console, so I assume the fax services are functioning corretly. Is there something I should add to the compile?

Gary

Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Sending Fax with Microsoft Fax Service
Posted: Wed Apr 29, 2009 10:55 AM

Did you have TEST.DOC in the current directory? It has to be a Word document.

EMG

Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Sending Fax with Microsoft Fax Service
Posted: Wed Apr 29, 2009 10:56 AM

And you must have Office installed.

EMG

Posts: 28
Joined: Mon Apr 27, 2009 03:37 PM
Re: Sending Fax with Microsoft Fax Service
Posted: Thu Apr 30, 2009 10:28 AM

Yes, a small word test.doc was in the current directory.

Gary

Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Sending Fax with Microsoft Fax Service
Posted: Thu Apr 30, 2009 10:48 AM

Sorry, I run out of ideas. :-(

EMG

Continue the discussion