We've recently upgraded to Windows XP (with service pack 2) and are having difficulties faxing with both the Fax service included with Windows XP and with Symantec Winfax 10.02. Tests have been performed with VPE v3.50 and VPE v3.60.
WinXP Fax Service
When manually opening a VPE document in the Vpe Viewer, we can click on the Print button, select the Fax printer, see the VPE "Printing" dialog open and close, fill out the WinXP "Send Fax Wizard", and the VPE document then appears in the Outbox of the "Fax Console", ready to be faxed. This is a success.
But when programatically sending a fax we have a failure. Here's the code used. We program in Progress, a database language.
PROCEDURE Fax:
DEFINE INPUT PARAMETER pcRecipient AS CHARACTER NO-UNDO.
DEFINE INPUT PARAMETER pcFaxNumber AS CHARACTER NO-UNDO.
DEFINE INPUT PARAMETER pcAttachment AS CHARACTER NO-UNDO.
DEFINE INPUT PARAMETER pcCoverpage AS CHARACTER NO-UNDO.
DEFINE VARIABLE objFaxDocument AS COM-HANDLE NO-UNDO.
DEFINE VARIABLE objFaxServer AS COM-HANDLE NO-UNDO.
DEFINE VARIABLE cJobID AS CHARACTER NO-UNDO.
/* Constants: http://msdn.microsoft.com/library/defau ... z_32er.asp */
DEFINE VARIABLE fptLOW AS INTEGER NO-UNDO INIT 0.
DEFINE VARIABLE fptNORMAL AS INTEGER NO-UNDO INIT 1.
DEFINE VARIABLE fptHIGH AS INTEGER NO-UNDO INIT 2.
DEFINE VARIABLE fcptNONE AS INTEGER NO-UNDO INIT 0.
DEFINE VARIABLE fcptLOCAL AS INTEGER NO-UNDO INIT 1.
DEFINE VARIABLE fcptSERVER AS INTEGER NO-UNDO INIT 2.
DEFINE VARIABLE frtNONE AS INTEGER NO-UNDO INIT 0.
DEFINE VARIABLE frtMAIL AS INTEGER NO-UNDO INIT 1.
DEFINE VARIABLE frtMSGBOX AS INTEGER NO-UNDO INIT 4.
CREATE "FaxComEx.FaxServer" objFaxServer NO-ERROR.
objFaxServer:Connect("").
/* http://msdn.microsoft.com/library/defau ... z_4isy.asp */
CREATE "FaxComEx.FaxDocument" objFaxDocument NO-ERROR.
objFaxDocument:Recipients:Add(pcFaxNumber, pcRecipient).
objFaxDocument:Body = pcAttachment.
IF pcCoverpage NE ""
THEN
ASSIGN
objFaxDocument:CoverPageType = fcptLOCAL
objFaxDocument:CoverPage = pcCoverpage.
ELSE
ASSIGN
objFaxDocument:CoverPageType = fcptNONE.
ASSIGN cJobID = objFaxDocument:ConnectedSubmit(objFaxServer) NO-ERROR.
RELEASE OBJECT objFaxDocument NO-ERROR.
RELEASE OBJECT objFaxServer NO-ERROR.
END PROCEDURE.
The parameters are a name (Fax Test), a fax number (1234567890), a fully qualified filename (c:\test.vpe), an empty string (""). The VPE "Printing" dialog appears, goes to 100%, disappears, but the VPE document does not appear in the Outbox of the "Fax Console". When faxing a PDF file (c:\test.pdf) Adobe Reader v7.0 loads,opens the file, and the fax document appears in the Fax Console. Adobe Reader remains open, something that many programmers have complained about to Adobe, without a satisfying resolution. When faxing a text file (c:\test.txt) a Notepad printing progress appears, closes, and the fax appears in the Fax Console. And when faxing a Word file (c:\test.doc), Word opens, loads the file, a printing progress dialog appears, closes, Word closes, and the fax appears in the Fax Console. The code works with .pdf, .txt, and .doc files but fails with .vpe files.
Symantec WinFax
Programatically faxing with Symantec WinFax is even worse now. .vpe, .doc, .txt, .pdf files all result in the "Creating Attachment Image" dialog informing us that "The selected attachment is being converted into a fax image", remains open seemingly forever, never generating an entry in Symantec's "Message Manager"'s Outbox. The same code was used with Win98 with success but obviously needs to be rewritten.
When manually faxing with the wizard and attaching .vpe, .doc, .txt, and .pdf files, their respective programs send a job to the WinFax printer and the attachment is successfully converted/rasterized for use within Symantec WinFax. And the Adobe Reader remains open, as in the case with WinXP Fax.
Registry
The VPE registry key points to VPE v3.60:
Key: HKEY_CLASSES_ROOT\vpedoc\Shell\printto\command
Value: C:\Program Files\VPE VIEW\vpeview.exe /t %1|%2
I've replaced that registry value with:
C:\SeeParam.bat "%1" "%2" "%3" "%4" "%5" "%6"
SeeParam.bat contains the following commands:
@echo 0 %0
@echo 1 %1
@echo 2 %2
@echo 3 %3
@echo 4 %4
@echo 5 %5
@echo 6 %6
@pause
When executed this starts a command prompt where the value of the parameters can be seen: parameter %0 contains the name of the batch file, parameter %1 contains the fully qualified VPE filename (c:\test.vpe), and parameter %2 contains Fax, the name of the WinXP Fax Printer. The other parameters are blanks. This shows that the parameters passed to VpeView.exe /t %1|%2 correspond to VpeView.exe /t c:\test.vpe|Fax, which are the file to be processed and the fax printer to receive the processed document. Parameter %2 is WinFax when faxing to Symantec Winfax.
Any help?