Microsoft KB Archive/841714

= The Print dialog box appears when you fax an HTML document programmatically =

Article ID: 841714

Article Last Modified on 1/18/2007

-

APPLIES TO


 * Microsoft Windows Server 2003, Standard Edition (32-bit x86)
 * Microsoft Windows XP Professional
 * Microsoft Windows 2000 Professional Edition

-



SYMPTOMS
When you try to fax an HTML document programmatically by using the fax APIs, a Print dialog box appears. The dialog box prompts you for user input.



CAUSE
This problem occurs because Microsoft Internet Explorer is designed to prevent the Web pages and scripts from sending faxes programmatically without user input.



STATUS
This behavior is by design.



MORE INFORMATION
When you fax a document, the fax service runs a shell command to search for the document type, and then the fax service calls the print to verb for that document type. The fax service runs the print to verb. If the print to verb succeeds, the fax service generates a Tagged Image File Format (.tiff) output file for that document.

Steps to reproduce the behavior
 Start Microsoft Visual Basic 6.0. The New Project dialog box appears. On the New tab, click Standard EXE, and then click Open. On the Project menu, click References. In the References - Project1 dialog box, click Microsoft Fax Service Extended COM Type Library, and then click OK.

Note You must install Fax Services to add the Microsoft Fax Service Extended COM Type Library reference. In the Project - Project1 window, right-click the Form1.frm form, and then click View Code.  In the Project1 - Form1 (Code) window, add the following code.

Note The  placeholder in this code is for a sample HTML file. The sender and recipient contact information is fictitious. Private Sub Form_Load Dim FaxDocumentObj As New FAXCOMEXLib.FaxDocument Dim FaxServerObj As New FAXCOMEXLib.FaxServer Dim JobIDObj As Variant

'Error handling. On Error GoTo Error_Handler

'Connect to the fax server. FaxServerObj.Connect &quot;&quot;

'Set the fax body. FaxDocumentObj.Body = &quot;c:\<SampleHTMLFile>&quot;

'Name the document. FaxDocumentObj.DocumentName = &quot;First Fax&quot;

'Set the fax priority. FaxDocumentObj.Priority = fptHIGH

'Add the recipient with the fax number 2065552626. FaxDocumentObj.Recipients.Add &quot;2065552626&quot;, &quot;<Recipient>&quot;

'Choose to attach the fax to the fax receipt. FaxDocumentObj.AttachFaxToReceipt = True

'Set the cover page type and the path of the cover page. FaxDocumentObj.CoverPageType = fcptSERVER FaxDocumentObj.CoverPage = &quot;generic&quot;

'Provide the cover page note. FaxDocumentObj.Note = &quot;This contains the information you requested.&quot;

'Provide the address for the fax receipt. FaxDocumentObj.ReceiptAddress = &quot;someone@example.com&quot;

'Set the receipt type to e-mail. FaxDocumentObj.ReceiptType = frtMAIL

'Specify that the fax is to be sent at a particular time FaxDocumentObj.ScheduleType = fstSPECIFIC_TIME 'CDate converts the time to the Date data type FaxDocumentObj.ScheduleTime = CDate(&quot;6:25:12 PM&quot;)

FaxDocumentObj.Subject = &quot;Today's fax&quot;

'Set the sender properties. FaxDocumentObj.Sender.Title = &quot;Mr.&quot; FaxDocumentObj.Sender.Name = &quot;Sender_Name&quot; FaxDocumentObj.Sender.City = &quot;Sender_City&quot; FaxDocumentObj.Sender.State = &quot;Sender_State&quot; FaxDocumentObj.Sender.Company = &quot;Sender_Company&quot; FaxDocumentObj.Sender.Country = &quot;Sender_Country&quot; FaxDocumentObj.Sender.Email = &quot;someone@somewebsite.com&quot; FaxDocumentObj.Sender.FaxNumber = &quot;4255550167&quot; FaxDocumentObj.Sender.HomePhone = &quot;4255550987&quot; FaxDocumentObj.Sender.OfficeLocation = &quot;My_Location&quot; FaxDocumentObj.Sender.OfficePhone = &quot;4255550334&quot; FaxDocumentObj.Sender.StreetAddress = &quot;123 Main Street&quot; FaxDocumentObj.Sender.TSID = &quot;Office Fax&quot; FaxDocumentObj.Sender.ZipCode = &quot;44118&quot; FaxDocumentObj.Sender.BillingCode = &quot;23A54&quot; FaxDocumentObj.Sender.Department = &quot;Accts Payable&quot;

'Save sender information as default. FaxDocumentObj.Sender.SaveDefaultSender

'Submit the document to the connected fax server, and retrieve the job ID.

JobIDObj = FaxDocumentObj.ConnectedSubmit(FaxServerObj)

MsgBox &quot;The Job ID is :&quot; & JobIDObj(0) Exit Sub

Error_Handler: 'Implement error handling at the end of your subroutine. This implementation is for demonstration purposes MsgBox &quot;Error number: &quot; & Hex(Err.Number) & &quot;, &quot; & Err.Description

End Sub </li> Install a fax printer to send a fax. If a fax printer is not installed, you receive error number 800710D8. The following is the error description:

Operation failed

</li> On the Run menu, click Start With Full Compile to run the program.

The Print dialog box that is mentioned in the &quot;Symptoms&quot; section appears.</li></ol>

<div class="references_section">