>I would like to know if anybody has had any problems using WINFAX DDE
>commands with VB 4.0 (Pro. Ed.).
I've used VB3 Pro (not VB4) to communicate with Winfax Pro 4 using
DDE, but in my application I was holding the fax details in a Word
document, not Access.
I used OLE-Automation to control Word from VB, and installed the
standard Winfax Word-print macro in Word, with most of the unnecessary
bits stripped out.
Amazingly, it worked.
Here is my modified Word print macro
--------------------------------------------------------------------------
' Now pass details to Winfax via DDE
ChanNum1 = DDEInitiate("FAXMNG", "TRANSMIT")
DDEPoke ChanNum1, "Sendfax", "recipient(" + faxnum$ + Chr$(44) +
faxtime$ + Chr$(44) + faxdate$ + Chr$(44) + faxname$ + Chr$(44) +
faxcompany$ + Chr$(44) + faxsubject$ + ")"
DDEPoke ChanNum1, "Sendfax", "resolution(" + faxres$ + ")"
DDEPoke ChanNum1, "Sendfax", "showsendscreen(" + faxmode$ + ")"
'DDEPoke ChanNum1, "Sendfax", "sendfaxui"
' Now print/fax the document
FilePrint
Goto finished
' DDE error handler
ddeerror:
On Error Goto 0
MsgBox "Error" + Str$(Err) + " occurred.", "Fax print error", 16
' Close the DDE channel
finished:
If ChanNum1 Then
DDETerminate ChanNum1
End If
' Return the default printer if necessary
If Not FaxDefault Then
FilePrintSetup .Printer = defprn$
EndIf
WaitCursor 0
End Sub
----------------------------
and here is the calling routine in VB3 - I called the Word macro "fax"
----------------------------------------------
wordobj.ToolsMacro "fax", True
DoEvents
---------------------------------
Have fun !
Richard