Sending Fax with Microsoft Fax Service

Sending Fax with Microsoft Fax Service

Postby Gary Woodley » 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: Select all  Expand view

   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
Gary Woodley
 
Posts: 28
Joined: Mon Apr 27, 2009 3:37 pm
Location: Oxford UK

Re: Sending Fax with Microsoft Fax Service

Postby Enrico Maria Giordano » Tue Apr 28, 2009 2:56 pm

This is a working sample:

Code: Select all  Expand view
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
User avatar
Enrico Maria Giordano
 
Posts: 8710
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Sending Fax with Microsoft Fax Service

Postby Gary Woodley » Wed Apr 29, 2009 8: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
Gary Woodley
 
Posts: 28
Joined: Mon Apr 27, 2009 3:37 pm
Location: Oxford UK

Re: Sending Fax with Microsoft Fax Service

Postby Enrico Maria Giordano » Wed Apr 29, 2009 9:36 am

Try this, works fine here:

Code: Select all  Expand view
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
User avatar
Enrico Maria Giordano
 
Posts: 8710
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Sending Fax with Microsoft Fax Service

Postby Gary Woodley » Wed Apr 29, 2009 10:13 am

Hi,

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

Gary
Gary Woodley
 
Posts: 28
Joined: Mon Apr 27, 2009 3:37 pm
Location: Oxford UK

Re: Sending Fax with Microsoft Fax Service

Postby Enrico Maria Giordano » Wed Apr 29, 2009 10:17 am

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

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8710
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Sending Fax with Microsoft Fax Service

Postby Gary Woodley » 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
Gary Woodley
 
Posts: 28
Joined: Mon Apr 27, 2009 3:37 pm
Location: Oxford UK

Re: Sending Fax with Microsoft Fax Service

Postby Enrico Maria Giordano » Wed Apr 29, 2009 10:55 am

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

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8710
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Sending Fax with Microsoft Fax Service

Postby Enrico Maria Giordano » Wed Apr 29, 2009 10:56 am

And you must have Office installed.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8710
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Sending Fax with Microsoft Fax Service

Postby Gary Woodley » Thu Apr 30, 2009 10:28 am

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

Gary
Gary Woodley
 
Posts: 28
Joined: Mon Apr 27, 2009 3:37 pm
Location: Oxford UK



Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 102 guests