Visual Basic.NET
  Home arrow Visual Basic.NET arrow Page 4 - More on Controlling Windows Fax Services U...
Iron Speed
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  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
ASP Web Hosting  
ASP.NET Web Hosting 
Dedicated Servers 
Download TestComplete 
Windows Web Hosting
 
IBM® developerWorks 
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 / 4
    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

    Ajax Application Generator Generate database and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!

    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.

     

    VISUAL BASIC.NET ARTICLES

    - Types of Operators in Visual Basic
    - Operators
    - Understanding Custom Events using Visual Bas...
    - Polymorphism using Abstract Classes in Visua...
    - Shadowing using Shadows in Visual Basic.NET ...
    - Overloading and Overriding in Visual Basic.N...
    - More on Controlling Windows Fax Services Usi...
    - Programmatically Controlling Windows Fax Ser...
    - Focusing on Forms and Menus in Visual Basic
    - Manipulating Forms with the Windows Forms Li...
    - Basics of the Windows Forms Library
    - Forms, Controls, and Other Useful Objects
    - Implementing OOP to Develop Database Oriente...
    - Using Themes and Skins for Personalization w...
    - A Deeper Look at Personalization using Visua...




    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway