I have MS Access VBA that looks something like this...
==================================================================
'Initialize WinFax Pro for faxing.
ChanNum = DDEInitiate("FAXMNG32", "CONTROL")
DDEExecute ChanNum, "GoIdle"
DDETerminate ChanNum
'Fax work orders one at a time.
For I = 1 To I
MyTechFaxName = DLookup("[TechName]", "tblTechInformation",
"[TechFaxDocument]='" & MyFileNameArray(I) & "'")
MyTechFaxNumber = Left(MyFileNameArray(I), 13)
MyTechFaxAttachment = "C:\TechSender\Outbox\" & MyFileNameArray(I)
Call SendFax(MyTechFaxName, MyTechFaxNumber, MyTechFaxAttachment)
Next I
ChanNum = DDEInitiate("FAXMNG32", "CONTROL")
DDEExecute ChanNum, "GoActive"
DDETerminate ChanNum
==================================================================
Now, my function SendFax looks like this...
==================================================================
Function SendFax(MyRecip As String, MyFAXNumber As String, MyAttachment
As String)
Dim ChanNum
Dim IsReady As Integer
Dim lRet As Long
Dim MyFAXMsg As Integer
Dim objFax As Object
Dim objLog As Object
Dim strEntryID As String
Set objFax = CreateObject("WinFax.SDKSend")
Set objLog = CreateObject("WinFax.SDKLog")
lRet = objFax.SetHold(0)
lRet = objFax.SetSubject("Daily Work Order Fax") 'Set FAX
subject
lRet = objFax.SetNumber(MyFAXNumber) 'Set FAX phone
number
lRet = objFax.SetTo(MyRecip) 'Set FAX
recipient
lRet = objFax.SetCompany("Kimberlite Corporation") 'Set FAX
company name
lRet = objFax.AddAttachmentFile(MyAttachment)
lRet = objFax.ShowSendScreen(0) '1=Show, 0=Hide
lRet = objFax.ShowCallProgress(1) '1=Show, 0=Hide
lRet = objFax.AddRecipient
lRet = objFax.Send(1) '1=Return
EventID, 0=No EventID
Do While objFax.IsReadyToPrint() = 0
DoEvents
Loop
lRet = objFax.Done
lRet = objFax.LeaveRunning
Set objFax = Nothing
End Function
I have WinFax Automation Server referenced in my Tools-->References.
My problem is, when the code cycles through the table of tech names and
tries to send each tech their fax, it leaves a Send dialog window open,
even though I tell it, with code, not to display.
I am using WinFax Pro version 10.03...