1 |
Option Explicit |
2 |
Sub Hylafax() |
3 |
' |
4 |
' Hylafax Macro |
5 |
' Macro created on 4/23/00 by Harald Holzer |
6 |
' |
7 |
Dim jobid |
8 |
Const Tmpfilename = "c:\temp\word2hyla.ps" |
9 |
Dim faxnumber |
10 |
Dim rc |
11 |
Dim Filename |
12 |
Const faxserver = "192.168.10.15" |
13 |
Const faxuser = "root" |
14 |
Dim faxsession |
15 |
|
16 |
WordBasic.FilePrintSetup Printer:="Hylafax", DoNotSetAsSysDefault:=1 |
17 |
WordBasic.ToolsOptionsPrint Background:=0 |
18 |
WordBasic.FilePrint PrintToFile:=1, PrToFileName:=Tmpfilename |
19 |
WordBasic.ToolsOptionsPrint Background:=1 |
20 |
WordBasic.FilePrintSetup Printer:="", DoNotSetAsSysDefault:=1 |
21 |
faxnumber = InputBox("Faxnumber:", "Fax senden") |
22 |
|
23 |
Set faxsession = CreateObject("pythonutils.hylafaxutil") |
24 |
|
25 |
rc = faxsession.Connect(faxserver, faxuser) |
26 |
jobid = faxsession.job_new() |
27 |
Call faxsession.job_param_set("FROMUSER ", CStr(faxuser)) |
28 |
Call faxsession.job_param_set("LASTTIME", "000300") |
29 |
Call faxsession.job_param_set("MAXDIAL", "12") |
30 |
Call faxsession.job_param_set("MAXTRIES", "3") |
31 |
Call faxsession.job_param_set("SCHEDPRI", "127") |
32 |
Call faxsession.job_param_set("DIALSTRING ", CStr(faxnumber)) |
33 |
Call faxsession.job_param_set("NOTIFYADDR ", faxuser) |
34 |
Call faxsession.job_param_set("NOTIFY", "done") |
35 |
Filename = faxsession.storefile(Tmpfilename) |
36 |
Call faxsession.job_param_set("DOCUMENT ", Filename) |
37 |
faxsession.submitjob |
38 |
|
39 |
faxsession.Close |
40 |
Set faxsession = Nothing |
41 |
|
42 |
End Sub |