422,024 Members | 1,010 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 422,024 IT Pros & Developers. It's quick & easy.

send html file FAXCOMEXLib

P: 1
Hello,

I try to send a html file using FAXCOMEXLib. The process go succesfull, but show the printer sellection windows. How can i do to not show this window?

The source code is this:

Expand|Select|Wrap|Line Numbers
  1. Private Sub EnviarFaxPorBroadcast(p_num As String, p_fichero As String, p_destinatario As String)
  2. Dim objFaxDocument As New FAXCOMEXLib.FaxDocument
  3. Dim collFaxRecipients As FaxRecipients
  4. Dim JobId As Variant
  5.  
  6. 'Error handling
  7. On Error GoTo Error_Handler
  8.  
  9. 'Set the fax body
  10. objFaxDocument.Body = "K:\Aplica\Protocolo\Trabajo\fax\fecha_vacia_27436.htm"
  11.  
  12. 'Name the document
  13. objFaxDocument.DocumentName = "Prueba"
  14.  
  15. 'Get the recipients collection
  16. Set collFaxRecipients = objFaxDocument.Recipients
  17.  
  18. 'Add the recipients
  19. With collFaxRecipients
  20.     .Add p_num, p_destinatario
  21. End With
  22.  
  23. 'Display number of recipients
  24. 'MsgBox "Number of recipients: " & collFaxRecipients.Count
  25.  
  26. 'Display recipient information
  27. 'Dim i As Long
  28. 'For i = 1 To collFaxRecipients.Count
  29. '    MsgBox "Recipient number " & i & ": " & collFaxRecipients.Item(i).Name & ", " & collFaxRecipients.Item(i).FaxNumber
  30. 'Next
  31.  
  32. 'Load the default sender
  33. objFaxDocument.Sender.LoadDefaultSender
  34.  
  35. 'Group the broadcast receipts
  36. objFaxDocument.GroupBroadcastReceipts = True
  37.  
  38. 'Connect to the fax server, submit the document, and get back the
  39. 'job ID array. "" indicates the local server.
  40. JobId = objFaxDocument.Submit("")
  41.  
  42. 'UBound finds the size of the array
  43. For n = 0 To UBound(JobId)
  44.     MsgBox "The Job ID is " & JobId(n)
  45. Next
  46.  
  47. 'Remove the recipients from the collection. If you don't take this step,
  48. 'and run this code again without closing the program, the recipients
  49. 'collection will retain the recipients and keep adding more recipients.
  50. 'The count and item numbering will change as you remove the items, so
  51. 'just remove item (1) Count times
  52. Dim lCount As Long
  53. lCount = collFaxRecipients.Count
  54. For I = 1 To lCount
  55.     collFaxRecipients.Remove (1)
  56. Next
  57. Exit Sub
  58.  
  59. Error_Handler:
  60.     'Implement error handling at the end of your subroutine. This
  61.     'implementation is for demonstration purposes
  62.     MsgBox "Error number: " & Hex(Err.Number) & ", " & Err.Description
  63.  
  64. End Sub
Feb 15 '07 #1
Share this Question
Share on Google+
1 Reply


100+
P: 1,646
Hi. Although I can guess, I want you to tell me what part of this code brings up the printer dialog
Feb 16 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.