tags:

views:

198

answers:

1

I'm trying to write a program that will send faxes to the Windows Fax system but I am having problems with the COM library FaxComEx.

My code:

try
{
    var faxServer = new FAXCOMEXLib.FaxServer();
    var faxDoc = new FAXCOMEXLib.FaxDocument();
    faxServer.Connect("");
    faxDoc.Body = @"C:\\test.txt";
    faxDoc.Recipients.Add("5551212", "Recipient");
    faxDoc.ConnectedSubmit(faxServer);
}

is supposed to work, but it fails whenever I try to send a fax and I'm not sure why. Any ideas?

A: 

Tom,

You are using both a literal qualifier and an escape character. You should just use one or the other.

Blockquote faxDoc.Body = @"C:\test.txt";

You should try ONE of the following.

  faxDoc.Body = @"C:\test.txt";

or

  faxDoc.Body = "C:\\test.txt";
opherko