Eric Sherman
asked on
Using Access/VB with WinFax
I have an Access 2k database that's used to create and send faxes to customers using WinFax. Everything works except sometimes WinFax will open the Send dialog form/box instead of letting the faxes build in the Outbox in WinFax. I have tried slowing down the process of passing the information from Access to Winfax to no avail.
Any help will be appreciated in trying to figure out how to stop WinFax from displaying the Send dialog box when fax information is sent to it via DDE.
Thanks,
ET Sherman
Any help will be appreciated in trying to figure out how to stop WinFax from displaying the Send dialog box when fax information is sent to it via DDE.
Thanks,
ET Sherman
ASKER
Thanks for the reply DanielSKim ....
The documentation relates to using WinFax's SDK. This is an older already developed program that uses DDE (Dynamic Data Exchange) to send the fax information over to WinFax.
ET
The documentation relates to using WinFax's SDK. This is an older already developed program that uses DDE (Dynamic Data Exchange) to send the fax information over to WinFax.
ET
ASKER
Daniel,
I looked at the WINFax SDK and I am having a little trouble with the code.
I need to be able to create a loop that sends a report to customers. This report is run in Access/VB and can be different for each customer. I tried to use the AddAtachment File function in the code but here I would have to first print the report to a PDF file when Access loops through the Customer table then let WinFax convert this file for faxing. That could become time consuming considering the number of customers that receive faxes plus it seems like WinFax automatically opens Acrobat in each case during the conversion process which will not work
I am trying to make this work just like it does using DDE. You initiate the call then let Access print the report down to the WinFax printer driver. I am having some problems with the following code. When I use the MakeAttachment function I can see the REPORT001.FXS, REPORT002.FXS, etc. fax files being created but the fax never makes it to the Outbox. Plus at various times I still get the WinFax Send Dialog Form opening especially if I try to send this code through a loop to create a fax for each customer.
Does anyone have some successful VB code that could be used to loop through a table of customers and print a Access report down to the WinFax driver WITHOUT the Send Dialog form opening up. WinFax tech support on this SDK is next to nothing and it is very time consuming to try and quess your way around it.
Set objWinFaxSend = CreateObject("Winfax.SDKSe nd")
objWinFaxSend.SetSubject ("Test Fax")
objWinFaxSend.SetNumber ("1234567")
objWinFaxSend.SetAreaCode ("504")
objWinFaxSend.SetTo (strSetTo)
objWinFaxSend.SetDate (strDate)
objWinFaxSend.SetTime (strTime)
objWinFaxSend.SetCompany ("ABC Company")
objWinFaxSend.AddRecipient
objWinFaxSend.SetPrintFrom App (1)
objWinFaxSend.MakeAttachme nt "REPORT", "C:\Program Files\WinFax\Data", 0
objWinFaxSend.Send (0)
DoCmd.OpenReport "MyReport", acViewNormal
retVal = objWinFaxSend.ShowSendScre en(0)
retVal = objWinFaxSend.Done
I looked at the WINFax SDK and I am having a little trouble with the code.
I need to be able to create a loop that sends a report to customers. This report is run in Access/VB and can be different for each customer. I tried to use the AddAtachment File function in the code but here I would have to first print the report to a PDF file when Access loops through the Customer table then let WinFax convert this file for faxing. That could become time consuming considering the number of customers that receive faxes plus it seems like WinFax automatically opens Acrobat in each case during the conversion process which will not work
I am trying to make this work just like it does using DDE. You initiate the call then let Access print the report down to the WinFax printer driver. I am having some problems with the following code. When I use the MakeAttachment function I can see the REPORT001.FXS, REPORT002.FXS, etc. fax files being created but the fax never makes it to the Outbox. Plus at various times I still get the WinFax Send Dialog Form opening especially if I try to send this code through a loop to create a fax for each customer.
Does anyone have some successful VB code that could be used to loop through a table of customers and print a Access report down to the WinFax driver WITHOUT the Send Dialog form opening up. WinFax tech support on this SDK is next to nothing and it is very time consuming to try and quess your way around it.
Set objWinFaxSend = CreateObject("Winfax.SDKSe
objWinFaxSend.SetSubject ("Test Fax")
objWinFaxSend.SetNumber ("1234567")
objWinFaxSend.SetAreaCode ("504")
objWinFaxSend.SetTo (strSetTo)
objWinFaxSend.SetDate (strDate)
objWinFaxSend.SetTime (strTime)
objWinFaxSend.SetCompany ("ABC Company")
objWinFaxSend.AddRecipient
objWinFaxSend.SetPrintFrom
objWinFaxSend.MakeAttachme
objWinFaxSend.Send (0)
DoCmd.OpenReport "MyReport", acViewNormal
retVal = objWinFaxSend.ShowSendScre
retVal = objWinFaxSend.Done
ASKER
Ok,
Even this code has problems with the Send Screen poping up when looping through a customer table with VB to create a fax to be sent to each customer. There have to be a way this can work without the Show Send Screen poping up.
Any help will be appreciated.....
Set objWinFaxSend = CreateObject("Winfax.SDKSe nd")
objWinFaxSend.SetSubject ("Test Fax")
objWinFaxSend.SetNumber ("1234567")
objWinFaxSend.SetAreaCode ("504")
objWinFaxSend.SetTo (strSetTo)
objWinFaxSend.SetDate (strDate)
objWinFaxSend.SetTime (strTime)
objWinFaxSend.SetCompany ("Some Company")
objWinFaxSend.AddRecipient
objWinFaxSend.SetPrintFrom App (1)
objWinFaxSend.AddAttachmen tFile ("")
objWinFaxSend.Send (0)
objWinFaxSend.ShowSendScre en (0)
DoCmd.OpenReport "MyReport", acViewNormal
objWinFaxSend.Done
Even this code has problems with the Send Screen poping up when looping through a customer table with VB to create a fax to be sent to each customer. There have to be a way this can work without the Show Send Screen poping up.
Any help will be appreciated.....
Set objWinFaxSend = CreateObject("Winfax.SDKSe
objWinFaxSend.SetSubject ("Test Fax")
objWinFaxSend.SetNumber ("1234567")
objWinFaxSend.SetAreaCode ("504")
objWinFaxSend.SetTo (strSetTo)
objWinFaxSend.SetDate (strDate)
objWinFaxSend.SetTime (strTime)
objWinFaxSend.SetCompany ("Some Company")
objWinFaxSend.AddRecipient
objWinFaxSend.SetPrintFrom
objWinFaxSend.AddAttachmen
objWinFaxSend.Send (0)
objWinFaxSend.ShowSendScre
DoCmd.OpenReport "MyReport", acViewNormal
objWinFaxSend.Done
ASKER
OK,
Looks like the following will work and elminates my problem. I will post it here for the benefit of anyone else that may run into the same issue. Basicaly this little sample/test code will loop 3 times to simulate looping through a Customer Table and create 3 faxes. The part that was needed and my original code was missing was the section that basically DoEvents and loops until IsEntryIDReady <> 1.
This solved the problem and thanks for all input that was provided on the subject.
ET
Function TestFax()
Dim objWinFaxSend As Object
Dim strDate As String
Dim strTime As String
Dim strSetTo As String
Dim intCust As Integer
Dim intCounter As Long
intCust = 0
strSetTo = "My Customer Name"
strDate = Format(DATE , "mm/dd/yy")
strTime = Format(Now(), "hh:mm:ss")
Do While intCust < 3
Set objWinFaxSend = CreateObject("Winfax.SDKSe nd")
objWinFaxSend.SetSubject ("Test Fax")
objWinFaxSend.SetNumber ("1234567")
objWinFaxSend.SetAreaCode ("713")
objWinFaxSend.SetTo (strSetTo)
objWinFaxSend.SetDate (strDate)
objWinFaxSend.SetTime (strTime)
objWinFaxSend.SetCompany ("Commercial Chemical")
objWinFaxSend.AddRecipient
objWinFaxSend.SetPrintFrom App (1)
objWinFaxSend.Send (1)
objWinFaxSend.ShowSendScre en (0)
Do While objWinFaxSend.IsReadyToPri nt = 0
DoEvents
Loop
DoCmd.OpenReport "MyReport", acViewNormal
intCust = intCust + 1
objWinFaxSend.Done
Do While objWinFaxSend.IsEntryIDRea dy(0) <> 1
DoEvents
Loop
Set objWinFaxSend = Nothing
DoEvents
Loop
End Function
Looks like the following will work and elminates my problem. I will post it here for the benefit of anyone else that may run into the same issue. Basicaly this little sample/test code will loop 3 times to simulate looping through a Customer Table and create 3 faxes. The part that was needed and my original code was missing was the section that basically DoEvents and loops until IsEntryIDReady <> 1.
This solved the problem and thanks for all input that was provided on the subject.
ET
Function TestFax()
Dim objWinFaxSend As Object
Dim strDate As String
Dim strTime As String
Dim strSetTo As String
Dim intCust As Integer
Dim intCounter As Long
intCust = 0
strSetTo = "My Customer Name"
strDate = Format(DATE , "mm/dd/yy")
strTime = Format(Now(), "hh:mm:ss")
Do While intCust < 3
Set objWinFaxSend = CreateObject("Winfax.SDKSe
objWinFaxSend.SetSubject ("Test Fax")
objWinFaxSend.SetNumber ("1234567")
objWinFaxSend.SetAreaCode ("713")
objWinFaxSend.SetTo (strSetTo)
objWinFaxSend.SetDate (strDate)
objWinFaxSend.SetTime (strTime)
objWinFaxSend.SetCompany ("Commercial Chemical")
objWinFaxSend.AddRecipient
objWinFaxSend.SetPrintFrom
objWinFaxSend.Send (1)
objWinFaxSend.ShowSendScre
Do While objWinFaxSend.IsReadyToPri
DoEvents
Loop
DoCmd.OpenReport "MyReport", acViewNormal
intCust = intCust + 1
objWinFaxSend.Done
Do While objWinFaxSend.IsEntryIDRea
DoEvents
Loop
Set objWinFaxSend = Nothing
DoEvents
Loop
End Function
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ftp://ftp.symantec.com/misc/sabu/winfax/wfxsdk.pdf