Solved

Sending a Fax using VB on XP

Posted on 2004-08-11
5
732 Views
Last Modified: 2009-12-16
Hi,

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.Disconnect
  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?
0
Comment
Question by:cossy74
5 Comments
 
LVL 5

Accepted Solution

by:
cristy56 earned 300 total points
ID: 11780209
#Mandix Repository#************************************************************
' * Programmer Name  : Dave Buckner
' * WebSite          : http://www.d2dsources.com
' * 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
   oFaxServer.Disconnect
   Set oFaxServer = Nothing
   Exit Sub

ErrHandler:
   MsgBox Err.Number & " " & Err.Description
   Err.Clear
End Sub

------------------------------------------------------------
Cristy
0
 
LVL 8

Assisted Solution

by:nishikanth
nishikanth earned 100 total points
ID: 11780580
0
 
LVL 13

Assisted Solution

by:imarshad
imarshad earned 100 total points
ID: 11780848
0
 
LVL 5

Expert Comment

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

Cristy

0
 

Author Comment

by:cossy74
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.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

746 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now