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


       · 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...
     

    VISUAL BASIC.NET ARTICLES

    - 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...
    - Movement and Player Statistics in a VB.NET T...





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 5 Hosted by Hostway
    Stay green...Green IT