.net faxing

  • Thread starter Thread starter Rob T
  • Start date Start date
R

Rob T

I'm looking for a VB.net solution so I can send faxes directly from the GDI.
I've found references to the FaxStartPrintJob, which are mostly referenced
in C#. Since I'm not a c# programmer, I have little understanding of how to
implement this.

Has anyone done this in VB and would you have an example. The closest thing
I can find is this:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fax/faxlegacy_1rzo.asp
....but most of this is over my head.

Thanks.

-Rob T.

PS. This question is also posted in the dotnet groups...with little
success. :-(
 
Hi Rob,

Just been down this path myself. I am using this procedure to fax out
of an ASP.net application but I have also tested it with vb.net.

You have to add a reference to a dll called faxcomlib.dll (FAXCOMLib).
I tested this with windows XP and Windows 2003.

Hope this helps

Dave

Sub SendFax()
Dim lngSend As Long
Dim strComputer As String
Dim oFaxServer As FAXCOMLib.FaxServer
Dim oFaxDoc As FAXCOMLib.FaxDoc

strComputer = ""
oFaxServer = New FAXCOMLib.FaxServer
oFaxServer.Connect(strComputer)
oFaxServer.ServerCoverpage = 0
oFaxDoc = oFaxServer.CreateDocument("c:\order.pdf")
With oFaxDoc
..FaxNumber = "33196480"
..DisplayName = "Fax Server"
lngSend = .Send
End With
oFaxDoc = Nothing
oFaxServer.Disconnect()
oFaxServer = Nothing
End Sub
 
Hi Dave,

This is the method I'm currently using to send out a text version...or any
other format as long as the app is installed on the server. I'm trying to
avoid this and create the "document" on-the fly and not writing it as a file
to disk.

MSDN has some info about this, but it looks like it can only be done in C++,
not C# or VB. I may write a little gateway program in C++ to allow this
someday, but can't take the time to do it now.

Thanks for your help.

-Rob T.
 
Hey Dave / Rob

I have a follow up question for both of you.
Dave you said you have an ASP .NET application that you can fax from,
is it a WebService that is hosted on the server that you send a file
to. Because I tried loading files on the server side on ASP .NET
web-service and it did not work?

Rob, you mentioned "I'm trying to avoid this and create the "document"
on-the fly and not writing it as a file to disk."

Are you making the call
objFaxDocument.Body = sFile;

on the server or the client?
 
everything is on the server side and I'm creating the 'document' in the
server's memory...in the same way you would create a doc for a printer (see
PrintDocument.Print in MSDN)
 
Hi Ravi,

It is not a Web service.

The faxing service is native to windows 2000/2003. To access it you
just need to add a reference to the faxcomlib library.

And then call the code as above.

I must warn you that I am still having security issues with getting
this to work on a domain controller.

Regards

Dave
 
Back
Top