Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

How to send a Fax from Powercobol application ?
Hi,
how can I send a Fax from an application written in Powercobol ?
Regards,
Massimo.



Report this thread to moderator Post Follow-up to this message
Old Post
Massimo
08-21-07 12:55 PM


Re: How to send a Fax from Powercobol application ?
Massimo wrote:
> Hi,
> how can I send a Fax from an application written in Powercobol ?
> Regards,
> Massimo.

Print to a fax printer?



Report this thread to moderator Post Follow-up to this message
Old Post
HeyBub
08-21-07 11:55 PM


Re: How to send a Fax from Powercobol application ?

"Massimo" <blue_max_53@hotmail.com> wrote in message
news:%Kyyi.92219$%k.235504@twister2.libero.it...
> Hi,
> how can I send a Fax from an application written in Powercobol ?
> Regards,
> Massimo.
>
Here is a workable solution that uses the COM component already in the XP
Operating System.

This is an optional install for XP, so you must go to Control Panel and
install the fax service first. (if it hasn't been already)

Select Add/Remove programs> Add or Remove Windows components.
Tick the box for Fax Service.

You can then configure the service from the printers and faxes dialogue. (Or
you can do it programmatically using the component described below.)

Having got a fax service running on the system, you now want to use it from
PowerCOBOL.

Here's an event procedure that allows you to set up and send a Fax with
standard cover page (which you can preconfigure or do dynamically under
program control.)  You must  set the repository to support COM, as I
described earlier.

>
ENVIRONMENT     DIVISION.
DATA            DIVISION.
WORKING-STORAGE SECTION.
01 progID  pic x(25) value "FaxServer.FaxServer.1".
01 objFAX OBJECT REFERENCE COM.
01 objFAXDoc OBJECT REFERENCE COM.
01 CPNote pic x(8) value "Hello...".
01 ServerName pic x(9) value "\\PetesP4". *> use the name
*> of the computer to which your fax modem
*> is attached.
01 DocToSend  pic x(13) value "SampleDoc.Doc".
01 FaxNumber  pic x(10) value "1234567890".
01 Truth      pic s9(5) comp-5 value POW-TRUE.

PROCEDURE       DIVISION.
invoke COM "CREATE-OBJECT"
using progID
returning objFAX
end-invoke

invoke objFax "Connect"
using ServerName
end-invoke

invoke objFax "CreateDocument"
using DocToSend
returning objFAXDoc
end-invoke

invoke objFAXDoc "SET-CoverpageNote"
using CPNote
end-invoke
invoke objFAXDoc "SET-FaxNumber"
using FaxNumber
end-invoke
invoke objFAXDoc "SET-SendCoverpage"
using Truth
end-invoke

invoke objFAXDoc "Send" *> sends the document
end-invoke

invoke objFax "Disconnect"
using ServerName
end-invoke

set objFAX  to null
set objFAXDoc to null

As you can see this is not too hard. It uses late binding so all parameters
must be By Reference.

There are many thousands of functions included with XP; it is worth taking a
look through them. Remember that COM components can be brokered through
CORBA now, so they can be accessed remotely from Linux systems also.

HTH,

Pete
--
"I used to write COBOL...now I can do anything."



Report this thread to moderator Post Follow-up to this message
Old Post
Pete Dashwood
08-22-07 08:55 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Cobol archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 06:19 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.