# Re: 各位通讯高手请照过来好吗!拜托!!

Posted by 洪扬 on December 01, 1998 at 22:57:23:

In Reply to: 各位通讯高手请照过来好吗!拜托!! posted by Gary Chen on December 01, 1998 at 15:24:43:

: 小弟想要做的是我在Basic中所产生出来的报表 .txt档案和所要送去的传真号码
: 直接给予传真程式然后它就会开始传真的动作了.
: 请问我该如何才能让程式去控制传真的动作,而不需要在每次传真时就要去操作传真程式

WinFax Pro这套传真程式的线上说明有利用DDE功能
直接在VB程式传送传真的范例,摘录如下给你参考,
看是不是你所需要的,WinFax Pro里有更详细的说明,
请自行参阅,如果试验成功,还请不吝公布让大家分享
一下你的心得! 祝好运!

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
□ot need to print to the WinFax printer
□river.

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

Follow Ups:

- Re: 各位通讯高手请照过来好吗!拜托!! 尧仔 11:36:31 12/02/98 (2)
  - Re: 各位通讯高手请照过来好吗!拜托!!请教尧仔先生 Gary Chen 16:58:33 12/02/98 (1)
    - Re: 各位通讯高手请照过来好吗!拜托!!请教尧仔先生 尧仔 12:58:05 12/03/98 (0)