Visual Basic.NET
  Home arrow Visual Basic.NET arrow Page 4 - More on Controlling Windows Fax Services U...
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Silverlight  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
ASP Web Hosting  
ASP.NET Web Hosting 
Windows Web Hosting
 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
VISUAL BASIC.NET

More on Controlling Windows Fax Services Using VB.Net
By: Luke Niland
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 6
    2007-07-25

    Table of Contents:
  • More on Controlling Windows Fax Services Using VB.Net
  • What is the Code Doing?
  • Submitting a Job to the Server
  • Explaining the Code

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    More on Controlling Windows Fax Services Using VB.Net - Explaining the Code


    (Page 4 of 4 )

    Okay, the first three lines are our object and the variables we will need. The only object here that we haven't seen before is the FAXCOMEXLib.FaxDocument. This is the object that is used to create the job and send. The other two lines are the connection to the server as we have seen before, and a variable that will hold the document we are going to fax.

    Now we are going to set all the properties of the job, and then send it. All this code is in a TRY/CATCH so we can gracefully handle any errors. First of all we connect to the fax server as we have done before. Then, we set the body of our objFaxDocument object to be the document we want to fax.

    You can fax any kind of document you like, as long as the PC running your application has the ability to open the document. In this case we are sending a pdf file, so your PC must have Adobe Reader or something similar installed. 

    Now we will set the other properties of the document. There are more available than what we have used here; these are just a guide. First of all set the DocumentName to be whatever you want to call it -- here we just name it "Test Fax" -- then we set the priority of the job. A higher priority job will get sent before a normal or low one.

    Now, we will tell the job where it is going, and who it is going to by adding a recipient to the job. You can add multiple recipients to each job; just use an Add for each one.

    After that we set the cover page options. If you don't want a cover page, you can use FAXCOMEXLib.FAX_COVERPAGE_TYPE_ENUM.fcptNONE. This will just send the document. Here we are telling the job to use a cover page on the server, and then giving it the name of the cover page. You can also use a local cover page if you have one.

    Next we set the receipt options. We give it an email address to send the receipt to, tell it not to attach the fax document to the receipt, and set the receipt type to be an email.

    We then set the subject of the job, and the sender name. We now have enough details to send the fax, so we use the ConnectedSubmit method of the document and give it to the fax server.

    If everything has worked okay, look at your fax server's outbox, and your job should be in there!


    DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

       · Hi,Thanks for this article, I have been trying for several days but I can...
       · Hi,That error does'nt ring any bells, but if you can post the chunk of code thats...
       · Hello,We are getting the same error when trying to attach the "Body" to the fax....
       · Hi, I have never been able to replicate this error. I assume you are getting it when...
       · When my vbs execute the line ConnectSubmit(FaxServer) each document is opened, any...
       · hi,i am trying to send multiple faxes automatically, but when i submit...
     

    VISUAL BASIC.NET ARTICLES

    - Clocks and Countdowns
    - User-defined Functions using Visual Basic Ap...
    - Understanding Object Binding in VBA
    - Mastering the Message Box
    - Testing a Windows Forms Application
    - Using Visual Basic.NET Features to Code a Wi...
    - Correcting Code in a Windows Forms Applicati...
    - Write Readable Code and Comments for Windows...
    - How to Code and Test a Windows Forms Applica...
    - Adding Features to a Windows Forms Applicati...
    - How to Design a Windows Forms Application
    - LINQ to XML Programming Using Visual Basic.N...
    - Understanding Delegates using Visual Basic.N...
    - Create a Sudoku Puzzle Generator using VB.NET
    - Entity Creation and Messaging in a VB.NET Te...





    © 2003-2010 by Developer Shed. All rights reserved. DS Cluster 1 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek