- This topic is empty.
-
AuthorPosts
-
September 20, 2006 at 1:37 pm #2741
lynniek
MemberI have the following code I pieced together from several posts I have seen. I am sorry I can’t credit the developer(s). I am trying to print a filtered report to WinFax filling in the cover page with data from an Access form. This is working but not together. Meaning I get one cover page with name, fax number and company filled in and it automatically sends. I get another cover page (basic) with the report attached. This one stays on the screen (doesn’t automatically send) and no information is filled in (fax number, company, name). Both of these things are happening when I click the button that runs this code.
PLEASE help. I have been going around and around with this code.
‘***Start code****
Dim objWinfaxSend As New wfxctl32.CSDKSend
Dim RetCode As Long
‘Set objWinfaxSend = CreateObject(“WinFax.SDKSend8.0”)
RetCode = objWinfaxSend.SetClientID(Me.Customer)‘Begin Recipient Settings
Application.Printer = Application.Printers(“WinFax”)
gstrReportFilter = “QuoteID = ” & Me.QuoteID
DoCmd.OpenReport “RPT_QuoteDetailsTotalWF”, , , gstrReportFilter
RetCode = objWinfaxSend.SetTo(Me.contactname)
RetCode = objWinfaxSend.SetNumber(Me.CustomerFax)
RetCode = objWinfaxSend.SetSubject(“Quote”)
RetCode = objWinfaxSend.SetCompany(Me.Customer) ‘
‘Destination
RetCode = objWinfaxSend.SetDeleteAfterSend(0) ‘ Do Not Delete
RetCode = objWinfaxSend.SetQuickCover(1) ‘ Yes
‘RetCode = objWinfaxSend.SetUseCover(1) ‘ Yes to Include a cover
RetCode = objWinfaxSend.SetCoverText(“Quoted by RIL”)
‘RetCode = objWinfaxSend.SetCoverFile(“C:ProgramFilesWinFaxCoverBasic1.CVP”)
RetCode = objWinfaxSend.AddRecipient
RetCode = objWinfaxSend.ShowCallProgess(1)
RetCode = objWinfaxSend.Send(1)
RetCode = objWinfaxSend.LeaveRunning ‘ This will leave Winfax controller running.Do While objWinfaxSend.IsReadyToPrint = 0
DoEvents
Loop
‘****END CODE****🙁
September 22, 2006 at 1:25 am #4699Anonymous
Memberok, there are a few items missing in your code if you want to print to the WinFax PRO printer driver (to fax a report from Access). The first is SetPrintFromApp(1) is required, and you need to print to the WinFax PRO printer after you set the recipient details (not before). I’ve also added the code to wait until an entry id is ready before moving on.
Dim objWinfaxSend As New wfxctl32.CSDKSend
Dim RetCode As Long
'Set objWinfaxSend = CreateObject("WinFax.SDKSend8.0")
RetCode = objWinfaxSend.SetClientID(Me.Customer)
'Begin Recipient Settings
RetCode = objWinfaxSend.SetTo(Me.contactname)
RetCode = objWinfaxSend.SetNumber(Me.CustomerFax)
RetCode = objWinfaxSend.SetSubject("Quote")
RetCode = objWinfaxSend.SetCompany(Me.Customer) Â Â Â Â Â '
'Destination
RetCode = objWinfaxSend.SetDeleteAfterSend(0) Â ' Do Not Delete
RetCode = objWinfaxSend.SetQuickCover(1) Â Â Â Â ' Yes
'RetCode = objWinfaxSend.SetUseCover(1) Â Â Â Â ' Yes to Include a cover
RetCode = objWinfaxSend.SetCoverText("Quoted by RIL")
'RetCode = objWinfaxSend.SetCoverFile("C:ProgramFilesWinFaxCoverBasic1.CVP")
RetCode = objWinfaxSend.AddRecipient
RetCode = objWinfaxSend.ShowCallProgess(1)
RetCode = objWinfaxSend.SetPrintFromApp(1)
RetCode = objWinfaxSend.Send(1)
RetCode = objWinfaxSend.LeaveRunning  ' This will leave Winfax controller running.
Do While objWinfaxSend.IsReadyToPrint = 0
 DoEvents
Loop
Application.Printer = Application.Printers("WinFax")
gstrReportFilter = "QuoteID = " & Me.QuoteID
DoCmd.OpenReport "RPT_QuoteDetailsTotalWF", , , gstrReportFilter
' Wait until the EntryID is ready before moving on.
' the Send(1) you specified before is used here.
' We don't care what the EntryID is,
' we just want to know that is it ready. Â
' this loop will wait but allow background processing to continue
' when ready IsEntryIDReady is not = to 1
 Do While objWinfaxSend.IsEntryIDReady(0) <> 1
  DoEvents
 Loop
I don’t have Access to test but this should work with WinFax PRO 10.03 or 10.04
Edited By Moderator on 1158888385
September 22, 2006 at 6:36 pm #4700lynniek
MemberThank you so much for the code revisions. Unfortunately it still does not work. I get one cover page with the report attached but the name, fax number, etc. do not pull from Access and fill out the cover page.
Any other thoughts would be appreciated.
September 24, 2006 at 12:51 am #4701Anonymous
MemberI would suggest hard coding the name, number etc. (replacing the Me.CustomerFax, Me.Contact) variables in your code for testing purposes only. This will confirm if the faxing (SDK) portion is working and not a specific problem with your access database (getting the name & number) from Access.
September 25, 2006 at 12:31 pm #4702lynniek
MemberI tried hard coding the name and fax number. This information did not make it to Winfax either. When the cover page appears, the report is attached and the fields show @R for name, @C for company, @X for fax number. After a one or two second delay, the @ in each field changes to
, , and . I have tried clicking send thinking maybe it was just not previewing correctly but I get a message that the fax is not addressed to anyone. Any other thoughts are appreciated.
🙁
September 25, 2006 at 1:57 pm #4703Anonymous
MemberAre you showing the SendScreen using ShowSendScreen(1) ?
because then this is working as designed. Cover page data variables only operate when ShowSendScreen is disabled using the ShowSendScreen(0) SDK function or DDE ShowSendScreen(“0”) command.By default the ShowSendScreen command is set to 0, and since I didn’t see it in your code I assumed you are not viewing the send screen after you create the report.
September 25, 2006 at 5:11 pm #4704lynniek
MemberI did have the “RetCode = objWinfaxSend.ShowCallProgess(1)” code typed. I deleted that line and still have the same issue. Attachment with cover page and no variable data inserted.
September 26, 2006 at 3:24 am #4705Anonymous
Member@lynniek wrote:
I did have the “RetCode = objWinfaxSend.ShowCallProgess(1)” code typed. I deleted that line and still have the same issue. Attachment with cover page and no variable data inserted.
you shouldn’t be seeing the send dialog box at all, if this appears, then something else is wrong. You mighr want to try adding ShowSendScreen(0) in your code.
The ShowCallProgress(1) command only displays the send status window while the fax is being sent, it doesn’t turn the send dialog box on or off.
September 26, 2006 at 5:18 pm #4706lynniek
MemberI added that line (ShowSendScreen(0) ). Starting to think that it is just not going to work.
Thanks for you thoughts. I also tried the DDE example from Helen Feddema. This works to get the information (fax number, customer) from Access into WinFax but again, the attachment doesn’t appear. I see it generate and it makes it to the Print Que. Never makes it to WinFax.
-
AuthorPosts
- You must be logged in to reply to this topic.