Visual Basic.NET
  Home arrow Visual Basic.NET arrow Page 3 - 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
     
     
    Iron Speed
     
    ADVERTISEMENT

    Free Web 2.0 Code Generator! Generate data entry 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 - Submitting a Job to the Server
    (Page 3 of 4 )

    Ok, now that we know how to get information from the server, it's time to try to send a fax. We are going to send a signal page job from our system, and use one of the built-in cover pages.

    You can add your own cover pages easily enough. Just open the Fax services manager on the server, and then right click on Cover page, new, cover page. This will launch the fax page editor and let you design your own cover page. You can add your company's logo and other details, and also drop in components that will be replaced with the recipient's name, number, and so forth when the fax is sent.

    Anyway, create another button on your form in Visual Studio, and add this code to it. I will explain it line by line in the next section.

    Dim objFaxServer As New FAXCOMEXLib.FaxServer    'connection to the server

    Dim objFaxDocument As New FAXCOMEXLib.FaxDocument 'fax document to send

    Dim strFaxPDFtoSend As String

     

    'local document to send

    strFaxPDFtoSend = "c:TestFax.pdf"

     

    Try

       'now we have all the info, we can try and send the job out

       'Connect to the fax server

       objFaxServer.Connect("fax-svr1")

       'Set the fax body  

       objFaxDocument.Body = strFaxPDFtoSend

     

       'Name the document

       objFaxDocument.DocumentName = "Fax from Test Application"

       'Set the fax priority

       objFaxDocument.Priority = FAXCOMEXLib.FAX_PRIORITY_TYPE_ENUM.fptNORMAL

       'Add the recipient with the fax no

       objFaxDocument.Recipients.Add("01772 123456", "Luke Niland")

       'Set the cover page type and the path to the cover page

        objFaxDocument.CoverPageType=
    FAXCOMEXLib.FAX_COVERPAGE_TYPE_ENUM.fcptSERVER

       objFaxDocument.CoverPage = "generic.cov"

       'Provide the address for the fax receipt

       objFaxDocument.ReceiptAddress = "luke@beakersoft.wanadoo.co.uk"

       'Dont attach the original fax to the email receipt

       objFaxDocument.AttachFaxToReceipt = False

       'Set the receipt type to email

       objFaxDocument.ReceiptType = FAXCOMEXLib.FAX_RECEIPT_TYPE_ENUM.frtMAIL

     

       'Subject into the cover

       objFaxDocument.Subject = "Test Fax"

       'Set the sender properties.

       objFaxDocument.Sender.Name = "Luke Niland"

     

       'Submit the document to the connected fax server

       objFaxDocument.ConnectedSubmit(objFaxServer)

     

    Catch ex As Exception

       Msgbox("Failed Sending Job" & ex.Message & " " & ex.GetBaseException.ToString)

    End Try

    More Visual Basic.NET Articles
    More By Luke Niland


     

    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 3 hosted by Hostway