Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

WinFax problems--Need Help

Status
Not open for further replies.

myboat

IS-IT--Management
Jan 15, 2002
14
US
Need help. Fax cover page is correctly created but the Access Report pages are not included. Any ideas. Code is below. Thanks all.

Jim
Set objWinFaxSend = CreateObject("WinFax.SDKSend8.0")
RetCode = objWinFaxSend.SetClientID(strRecipient)

'Begin Recipient Settings
''Application.Printer = Application.Printers("WinFax")
RetCode = objWinFaxSend.SetTo(strRecipient)
RetCode = objWinFaxSend.SetNumber(strFaxNumber)
RetCode = objWinFaxSend.SetSubject("Subject Is here")
RetCode = objWinFaxSend.SetCompany(strRecipient) ' Destination
RetCode = objWinFaxSend.SetDeleteAfterSend(0) ' Do Not Delete
RetCode = objWinFaxSend.SetQuickCover(0) ' No
RetCode = objWinFaxSend.SetUseCover(1) ' Yes to Include a cover
RetCode = objWinFaxSend.SetCoverText("Today's Invoices")
RetCode = objWinFaxSend.SetCoverFile("C:\Program Files\WinFax\Cover\Basic1.CVP")
RetCode = objWinFaxSend.AddRecipient
RetCode = objWinFaxSend.AddAttachment(1)
RetCode = objWinFaxSend.ShowCallProgess(1)
RetCode = objWinFaxSend.Send(1)

Do While objWinFaxSend.IsReadyToPrint = 0
DoEvents
Loop

DoCmd.OpenReport "rptDaily Invoices", , , MySoldToTable!SoldToID ' <--- I know this works

SleepAPI 200
SleepAPI 200

' was there an error?
If RetCode <> 0 Then
MsgBox "There was a Fax Error = " & RetCode, vbOKOnly
Else
MsgBox "Fax has been sent!", vbInformation
End If
 
First, I've never used WinFax via code, but I see a couple of strange things here.

1. Not sure how WinFAx deals with returning 'RetCode', but it appears WinFax simply returns a status and keeps on going. In this case, unless you check the status after EACH call, you may blast right past an error and not know it.
2. The method you are using for 'AddAttachment' doesn't make sense to me. You have not attached anything by the time you issue the '.Send'. Do you need to run the report, saving to a file, then attach that file?

"Hmmm, it worked when I tested it....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top