B
Bob
Hi,
Has anyone succeeded iin getting Faxing to work on FrameWork 1.1 running on
a Win 2k box.
The example code in the help fails.
I adapted it to the sniippet below but FaxDoc.send is returning invalid
data.
This is a cross post from dotnet.languages.vb because I saw in that in the
archives of this group somelse had the same problem in C#.
Essentially I can't send 'simple' FAXes. ie Make a text file and send it.
I can send 'complicated' faxes ie. Make a word doc fill it with the info and
fax it.
A real basic question.
How do I fax a simple text file?
thanks
bob
***CODE SNIPPET****
Dim FaxServer As New FAXCOMLib.FaxServer
Dim FaxDoc As FAXCOMLib.FaxDoc
Dim strFaxFile As String
Dim strDirectory As String
Dim fs As FileStream
Dim intResult As Int32
Dim strFaxnumber As String = "1,4555555"
strDirectory = "c:\temp\FAX"
strFaxFile = strDirectory & "\Notify" & Now().ToFileTime & ".txt"
If Not (File.Exists(strFaxFile)) Then
fs = File.Create(strFaxFile)
Dim info As Byte() = New UTF8Encoding(True).GetBytes("Test Message from
Bob")
fs.Write(info, 0, info.Length)
fs.Close()
Else
End If
FaxServer.Connect(Environment.MachineName)
FaxDoc = CType(FaxServer.CreateDocument(strFaxFile), FAXCOMLib.FaxDoc)
FaxDoc.RecipientName = "Tester"
FaxDoc.FaxNumber = strFaxnumber
intResult = FaxDoc.Send *****Error Here. Data invalid"
FaxServer.Disconnect()
End Sub
Has anyone succeeded iin getting Faxing to work on FrameWork 1.1 running on
a Win 2k box.
The example code in the help fails.
I adapted it to the sniippet below but FaxDoc.send is returning invalid
data.
This is a cross post from dotnet.languages.vb because I saw in that in the
archives of this group somelse had the same problem in C#.
Essentially I can't send 'simple' FAXes. ie Make a text file and send it.
I can send 'complicated' faxes ie. Make a word doc fill it with the info and
fax it.
A real basic question.
How do I fax a simple text file?
thanks
bob
***CODE SNIPPET****
Dim FaxServer As New FAXCOMLib.FaxServer
Dim FaxDoc As FAXCOMLib.FaxDoc
Dim strFaxFile As String
Dim strDirectory As String
Dim fs As FileStream
Dim intResult As Int32
Dim strFaxnumber As String = "1,4555555"
strDirectory = "c:\temp\FAX"
strFaxFile = strDirectory & "\Notify" & Now().ToFileTime & ".txt"
If Not (File.Exists(strFaxFile)) Then
fs = File.Create(strFaxFile)
Dim info As Byte() = New UTF8Encoding(True).GetBytes("Test Message from
Bob")
fs.Write(info, 0, info.Length)
fs.Close()
Else
End If
FaxServer.Connect(Environment.MachineName)
FaxDoc = CType(FaxServer.CreateDocument(strFaxFile), FAXCOMLib.FaxDoc)
FaxDoc.RecipientName = "Tester"
FaxDoc.FaxNumber = strFaxnumber
intResult = FaxDoc.Send *****Error Here. Data invalid"
FaxServer.Disconnect()
End Sub