Solved

Send faxes using FaxComLib

Posted on 2013-11-28
1
273 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
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
Need to grow your business through quality cloud solutions? With everything required to build a cloud platform and solution, you may feel like the distance between you and the cloud is quite long. Help is here. Spend some time learning about the Con…
A simple description of email encryption using a secure portal service. This is one of the choices offered by The Email Laundry for email encryption. The other choices are pdf encryption which creates an encrypted pdf of your email and any attachmen…

911 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

21 Experts available now in Live!

Get 1:1 Help Now