Link to home
Start Free TrialLog in
Avatar of bobpaton
bobpaton

asked on

DDE from access to winfax 8.0

I have been able to automate the process of faxing using fields within VB5.0 going thru winfax8.0 but I need to be able to do it thru access95. If anyone has some code which might help it would be appreciated. I used the sample code that came with winfax8.0 to automate the process within VB5.0 but the same code will not work in access.
The code used with VB is as follows:

Sub Command1_Click ()

FAXNumber$ = "555-1212"
SendTime$ = "06:00:00"
SendDate$ = "12/25/96"
FAXName$ = "Benjamin Smith"
Company$ = "Data Processing Services"
Subject$ = "Joy of Faxing"
Keyword$ = "fax, joy"
BillingCode$ = "5905-001-xx"
Mode$ = "Fax"
CoverPage$ = "C:\DATA\WINFAX\COVERS\GENERAL.CVP"
CoverText$ = "Do enjoy this seasonal message."
Attachment$ = "C:\DATA\OTHER\XMASTREE.FXR"
'This is the start of the DDE to WinFax.
'Create the link and disable
'automatic reception in WinFax.
Label1.LinkTopic = "FAXMNG32|CONTROL"
Label1.LinkMode = 2
Label1.LinkTimeout = -1
Label1.LinkExecute "GoIdle"
Label1.LinkMode = 0
'Create a new link with the TRANSMIT topic.
Label1.LinkTopic = "FAXMNG32|TRANSMIT"
Label1.LinkMode = 2
Label1.LinkTimeout = -1
Label1.LinkItem = "sendfax"
'Start DDEPokes to control WinFax.
recip$ = "recipient(" & Chr$(34) & FAXNumber$ & Chr$(34) & "," & Chr$(34) & SendTime$ & Chr$(34) & "," & Chr$(34) & SendDate$ & Chr$(34) & ","
recip$ = recip$ & Chr$(34) & FAXName$ & Chr$(34) & "," & Chr$(34) & Company$ & Chr$(34) & "," & Chr$(34) & Subject$ & Chr$(34) & ","
recip$ = recip$ & Chr$(34) & Keyword$ & Chr$(34) & "," & Chr$(34) & BillingCode$ & Chr$(34) & "," & Chr$(34) & Mode$ & Chr$(34) & ")"
Label1.Caption = recip$
Label1.LinkPoke
'setcoverpage
Label1.Caption = "setcoverpage(" & Chr$(34) & CoverPage$ & Chr$(34) & ")"
Label1.LinkPoke
'fillcoverpage
Label1.Caption = "fillcoverpage(" & Chr$(34) & CoverText$ & Chr$(34) & ")"
Label1.LinkPoke
'attach
Label1.Caption = "attach(" & Chr$(34) & Attachment$ & Chr$(34) & ")"
Label1.LinkPoke
'showsendscreen
Label1.Caption = "showsendscreen(""1"")"
Label1.LinkPoke
'resolution
Label1.Caption = "resolution(""HIGH"")"
Label1.LinkPoke
'The SendfaxUI parameter is used only
'when a fax-ready cover page and/or
'attachments are included and you do
‘not need to print to the WinFax printer
‘driver.
Label1.Caption = "SendfaxUI"
Label1.LinkPoke
'Send the fax.
Label1.LinkTopic = "FAXMNG32|CONTROL"
Label1.LinkMode = 2
Label1.LinkTimeout = -1
Label1.LinkExecute "GoActive"
'Close the link between the applications.
Label1.LinkMode = 0
End Sub

All comments that were in the original helpfile with winfax8.0 have been left in. This works also if you make the fixed settings variables. I just need to be able to get it to work in Access95.
Avatar of Trygve
Trygve

Provide the code, if it is not to long, so we can have a look at it. Also include any error messages og symptoms other than the fact that it is not working.
Avatar of bobpaton

ASKER

Edited text of question
Adjusted points to 150
ASKER CERTIFIED SOLUTION
Avatar of IanHinson
IanHinson

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Most of it worked, I was able to debug a couple of the areas that didn't work but thanks for the help it is much appreciated