Sending a Fax using VB on XP

Posted on 2004-08-11
Last Modified: 2009-12-16

i have this code

Public Sub SendFax()
  Dim FaxServer As Object
  Dim FaxDoc As Object
  Set FaxServer = CreateObject("Faxserver.FaxServer")
  'Create FaxServer object...
  '<---This line does not produces an error.
  If (FaxServer.Connect("Fax")) Then
    MsgBox "Failed to connect"
  End If
  'Create document
  Dim FaxFile As String
  FaxFile = "C:\Work\Projects\Serck Controls\Vb\FaxSender\Message.txt"
  Set FaxDoc = FaxServer.CreateDocument(FaxFile)
  FaxDoc.FaxNumber = "0,49543543"
  FaxDoc.RecipientName = "John Doe"
  Dim iReturn As Integer
  iReturn = FaxDoc.Send                     '<--- Failed to Send
  FaxDoc = Nothing
  FaxServer = Nothing
End Sub

I have referenced the fxscom.dll but it fails to send can anyone help?
Do i have to set anything up in the xp enviroment?
Question by:cossy74
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Accepted Solution

cristy56 earned 300 total points
ID: 11780209
#Mandix Repository#************************************************************
' * Programmer Name  : Dave Buckner
' * WebSite          :
' * Date             : 16/05/02
' **********************************************************************
' * Comments         : Fax with Win2k & XP
' *
' * Fax with Win2k & XP
' *
' **********************************************************************
Description:With this snippet you can fax from any windows 2000 and
windows XP box with Fax Services! The only other way to share a fax
otherwise is Small Business server. All feedback is welcome!
Assumes: Make a reference to Fax COM Type lib 1.0
Private Sub Form_Load()
   Dim lngSend          As Long
   Dim strComputer      As String
   Dim oFaxServer       As FAXCOMLib.FaxServer
   Dim oFaxDoc          As FAXCOMLib.FaxDoc
   On Error Goto ErrHandler
   strComputer = "yourComputerName"
   Set oFaxServer = New FAXCOMLib.FaxServer
   oFaxServer.Connect strComputer
   oFaxServer.ServerCoverpage = 0
   Set oFaxDoc = oFaxServer.CreateDocument(App.Path & "\" & "New Text Document.txt")
   With oFaxDoc
      .FaxNumber = "5551212"
      .DisplayName = "Fax Server"
      lngSend = .Send
   End With
   Set oFaxDoc = Nothing
   Set oFaxServer = Nothing
   Exit Sub

   MsgBox Err.Number & " " & Err.Description
End Sub


Assisted Solution

nishikanth earned 100 total points
ID: 11780580
LVL 13

Assisted Solution

imarshad earned 100 total points
ID: 11780848

Expert Comment

ID: 11790166
Hi, how is your problem going on ? have u solved it ?



Author Comment

ID: 11865850
Sorry, i went away on holidays an got back this morning.
Crisy56: No the problem exists because to solutions require exchange which i donot have.
If i have read these answer wrongly please advise.

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

691 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question