通过程序控制Windows传真发送。
折腾了半天,搞了两个MODEM,终于。。。
下例仅以Jscript实现,其他版本参考可得。
自己记下来也希望对你有帮助^_^。
注意:
此段代码仅对WinXp有效,Win 2000及Win 98发送方法各不相同;
参考:
http://members.optusnet.com.au/~hssandler1/VBScript.htm
http://www.dotnetjunkies.com/Forums/ShowPost.aspx?PostID=2932
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fax/faxlegacyvb_836n.asp
///////////////////////////////////////
// Title: Fax send sample code
// Date: 2005-1-18
// Author: runmin@tom.com
///////////////////////////////////////
// Get the fax server
var faxServer = new ActiveXObject("FAXCOMEX.FaxServer");
faxServer.Connect("");
// Create a fax document
var doc = new ActiveXObject("FAXCOMEX.FaxDocument");
// Specify a content file, any printable file.
doc.Body = "C:\\Program Files\\Kingsoft\\Powerword 2003\\Tips.txt";
doc.DocumentName = "Fax Test Sample";
// Recipients
doc.Recipients.Add("820") // to fax number here
// Sender properties
doc.Sender.Name = "mruan"
doc.Sender.FaxNumber = "806" // from fax number here
// Send the fax doc
doc.ConnectedSubmit(faxServer)
// Title: Fax send sample code
// Date: 2005-1-18
// Author: runmin@tom.com
///////////////////////////////////////
// Get the fax server
var faxServer = new ActiveXObject("FAXCOMEX.FaxServer");
faxServer.Connect("");
// Create a fax document
var doc = new ActiveXObject("FAXCOMEX.FaxDocument");
// Specify a content file, any printable file.
doc.Body = "C:\\Program Files\\Kingsoft\\Powerword 2003\\Tips.txt";
doc.DocumentName = "Fax Test Sample";
// Recipients
doc.Recipients.Add("820") // to fax number here
// Sender properties
doc.Sender.Name = "mruan"
doc.Sender.FaxNumber = "806" // from fax number here
// Send the fax doc
doc.ConnectedSubmit(faxServer)