Solved

Send faxes using FaxComLib

Posted on 2013-11-28
1
282 Views
Last Modified: 2013-12-18
Hi, Ive got a grid with a few files (.pdfs)and fax numbers so can anybody give me an example of how to use 'faxcomlib' to send these files by fax??

thanks!
0
Comment
Question by:arcross
[X]
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
1 Comment
 
LVL 13

Accepted Solution

by:
duncanb7 earned 500 total points
ID: 39687780
You can try this example code only, just idea only and Not completed code for your
code  starting  , other thing you need to analysis and debug it by yourself. It seems it is not easy

Hope understand your question completely. If not please advise it

Duncan

Imports FAXCOMLib

Public Class Form1
Inherits System.Windows.Forms.Form



#Region " Windows Form Designer generated code "

Public Sub New()
MyBase.New()

'This call is required by the Windows Form Designer.
InitializeComponent()

'Add any initialization after the InitializeComponent() call

End Sub

'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub

'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer

'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer. 
'Do not modify it using the code editor.
Friend WithEvents Button1 As System.Windows.Forms.Button
Friend WithEvents OpenFileDialog1 As System.Windows.Forms.OpenFileDialog
Friend WithEvents Label1 As System.Windows.Forms.Label
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Me.Button1 = New System.Windows.Forms.Button()
Me.OpenFileDialog1 = New System.Windows.Forms.OpenFileDialog()
Me.Label1 = New System.Windows.Forms.Label()
Me.SuspendLayout()
'
'Button1
'
Me.Button1.Location = New System.Drawing.Point(80, 89)
Me.Button1.Name = "Button1"
Me.Button1.Size = New System.Drawing.Size(128, 23)
Me.Button1.TabIndex = 0
Me.Button1.Text = "Select File To Send"
'
'Label1
'
Me.Label1.Font = New System.Drawing.Font("Microsoft Sans Serif", 14.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label1.Location = New System.Drawing.Point(24, 33)
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(240, 23)
Me.Label1.TabIndex = 1
Me.Label1.Text = "Send File To Fax"
Me.Label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
'
'Form1
'
Me.AcceptButton = Me.Button1
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.ClientSize = New System.Drawing.Size(292, 144)
Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.Label1, Me.Button1})
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow
Me.Name = "Form1"
Me.Text = "FaxIt"
Me.ResumeLayout(False)

End Sub

#End Region



Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Try
Dim fo As New OpenFileDialog()
fo.Filter = "Microsoft Word Document (*.doc)|*.doc| Adobe PDF (*.pdf)|*.pdf"
If fo.ShowDialog = DialogResult.OK Then
If fo.FileName = "" Then
Exit Sub
End If
Else
Exit Sub
End If

Dim fxsvr = New FAXCOMLib.FaxServer()
Dim fxdoc = fxsvr.CreateDocument(fo.FileName)

Try
fxsvr.Connect("KEITH" 'Machine Name

Catch ex As Exception

MessageBox.Show(ex.ToString())

End Try
fxdoc.FileName = fo.FileName
fxdoc.FaxNumber = InputBox("Fax Number:", "Enter Fax Number", -1, -1)
fxdoc.RecipientName = ""

Try

fxdoc.Send()

Catch ex As Exception

MessageBox.Show(ex.ToString())

End Try

fxsvr.Disconnect()

Catch ex As Exception

MessageBox.Show(ex.message() & ControlChars.CrLf & ControlChars.CrLf & ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)

End Try

End Sub
End Class

Open in new window

0

Featured Post

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

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

If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

751 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