D
Dan Williams
I am trying in vain to programmatically send a PDF document using the
SBS Shared Fax Service and an ASP.NET web page.
I have managed to use the following VB.NET code to send a Word
document via my own XP development PC using its fax service, but it
doesn't appear to work on our SBS 2000 server.
Sub SendFax()
Dim fxsvr As New FAXCOMLib.FaxServerClass
Dim fxdoc As FAXCOMLib.FaxDoc
Dim strFileName as String = "C:\test.pdf"
Try
fxsvr.Connect("")
fxdoc = CType(fxsvr.CreateDocument(strFileName),
FAXCOMLib.FaxDoc)
fxdoc.FaxNumber = "01234 567890"
fxdoc.Send()
fxsvr.Disconnect()
Catch ex As Exception
Response.Write("<B>" + ex.ToString() + "</b><BR>")
End Try
End Sub
I've read the Microsoft Q301109 article about using an
Outlook.Application object with the SBS Shared Fax Service, but there
are issues with permissions as the ASP.NET account doesn't have access
to an Outlook profile.
I've attempted to impersonate a valid domain user using the Microsoft
Q248187 article, but this complains with an error when calling the
LogonUser function:-
System.NullReferenceException: Object reference not set to an instance
of an object.
Aren't there also issues with impersonating a different user with
ASP.NET and Windows/SBS 2000? Also, if using Outlook is my only option
with SBS, i doubt i'm going to be able to make the email body the same
as our PDF contents!!
Anybody got any bright ideas as i seem to be going around in circles
with this?
Would it be an option to uninstall the SBS Shared Fax Service and just
have the standard Microsoft Fax Service (as i have on my XP
development machine)? I've also struggled to get the standard Fax
Service to send PDF faxes from ASP.NET, but it does work if i simply
print to the fax printer from Acrobat Reader!!
Is there any third-party software i can try in order to send PDF files
via our Intranet application?
Just out of interest, our PDF files are dynamically created by Crystal
Reports and need to be faxed to clients fax numbers from our SQL
database. Ideally, they have to be PDF files as the forms get faxed
back by our clients and scanned by our OCR software with the results
automatically imported to our SQL database. That way the PDF forms
remain the same size and format without the fear of user intervention
with margins and page setup, etc. and hence our OCR software can
recognise the returned forms.
Any help is much appreciated.
Thanks in advance.
Dan Williams.
SBS Shared Fax Service and an ASP.NET web page.
I have managed to use the following VB.NET code to send a Word
document via my own XP development PC using its fax service, but it
doesn't appear to work on our SBS 2000 server.
Sub SendFax()
Dim fxsvr As New FAXCOMLib.FaxServerClass
Dim fxdoc As FAXCOMLib.FaxDoc
Dim strFileName as String = "C:\test.pdf"
Try
fxsvr.Connect("")
fxdoc = CType(fxsvr.CreateDocument(strFileName),
FAXCOMLib.FaxDoc)
fxdoc.FaxNumber = "01234 567890"
fxdoc.Send()
fxsvr.Disconnect()
Catch ex As Exception
Response.Write("<B>" + ex.ToString() + "</b><BR>")
End Try
End Sub
I've read the Microsoft Q301109 article about using an
Outlook.Application object with the SBS Shared Fax Service, but there
are issues with permissions as the ASP.NET account doesn't have access
to an Outlook profile.
I've attempted to impersonate a valid domain user using the Microsoft
Q248187 article, but this complains with an error when calling the
LogonUser function:-
System.NullReferenceException: Object reference not set to an instance
of an object.
Aren't there also issues with impersonating a different user with
ASP.NET and Windows/SBS 2000? Also, if using Outlook is my only option
with SBS, i doubt i'm going to be able to make the email body the same
as our PDF contents!!
Anybody got any bright ideas as i seem to be going around in circles
with this?
Would it be an option to uninstall the SBS Shared Fax Service and just
have the standard Microsoft Fax Service (as i have on my XP
development machine)? I've also struggled to get the standard Fax
Service to send PDF faxes from ASP.NET, but it does work if i simply
print to the fax printer from Acrobat Reader!!
Is there any third-party software i can try in order to send PDF files
via our Intranet application?
Just out of interest, our PDF files are dynamically created by Crystal
Reports and need to be faxed to clients fax numbers from our SQL
database. Ideally, they have to be PDF files as the forms get faxed
back by our clients and scanned by our OCR software with the results
automatically imported to our SQL database. That way the PDF forms
remain the same size and format without the fear of user intervention
with margins and page setup, etc. and hence our OCR software can
recognise the returned forms.
Any help is much appreciated.
Thanks in advance.
Dan Williams.