Word 2003 gives error while sending fax in asp.net application

P

Patel Mitesh

Hi All,

I have developed one fax Application in asp.net, on windows 2003 and use the
office 2003 to send the fax.

I used the .txt file format to send the fax and it works but when i try with
..doc than it gives me error.

The code is given belw


I have searched a lot for this application and i got at last that this the
problem due to office 2003 so please help me to solve this problem.

Thanks in Advance

Mitesh Patel
 
P

Peter Jamieson

You forgot to include your code.

Are you "printing" the .doc to the fax printer somehow? If so, how?

What I have found in the past is that things are more likely to work if you
explicitly Automate Word to produce a .tif file which you then print to the
fax printer.

The following article is actually about using Mail Merge to print to fax, so
it contains more material than you probably need, but you may find it
useful:

http://tips.pjmsn.me.uk/t0001.htm

Unfortunately I am no longer in a good position to test fax-related issues.

Peter Jamieson
 
P

Patel Mitesh

Hi, Peter

Thanks for your reply. sorry that i forget to include my code.

The code is given below.

Imports FAXCOMEXLib
Imports System.IO
Partial Class _Default
Inherits System.Web.UI.Page

Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Load
Dim fsc As New FaxServerClass
Dim doc As New FaxDocumentClass
doc.Body = "c:\TEST.doc"
doc.DocumentName = "test.doc"
doc.Priority = FAX_PRIORITY_TYPE_ENUM.fptNORMAL
doc.Recipients.Add("9084509299", "Mitesh Patel")
doc.ReceiptType = 0
doc.ScheduleType = 0
doc.Sender.Name = "Test Fax"
doc.Sender.TSID = "FAX"
doc.AttachFaxToReceipt = True
Do_Conn(fsc, doc)
End Sub
Private Sub Do_Conn(ByVal fsc As FaxServerClass, ByVal doc As
FaxDocumentClass)
Try
Dim servername As String
fsc.Connect("rangam03")
fsc.Connect("rangam03")
servername = fsc.ServerName
'doc.AttachFaxToReceipt = false;
doc.ConnectedSubmit(fsc)
fsc.Disconnect()
Catch ex As UnauthorizedAccessException
ErrLabel.Text = ex.ToString()

Catch eio As IOException
ErrLabel.Text = eio.ToString()
Catch e As Exception
ErrLabel.Text = e.ToString()
End Try
End Sub
End Class

The line " doc.ConnectedSubmit(fsc)" does everything. It automatically
convert the .txt file to .tif file but not able to convert the .doc file to
..tif file and that also through the fax printer. So pls help me to resolve
this issue.

My email address is (e-mail address removed). If you know any person who does this
thing in past than please let me know through mail. Your prompt reply is
appreciated

Thanks & Regards,

Mitesh Patel
 
P

Peter Jamieson

I forgot to ask the obvious question: do you actually have Word on the
system that is sending the faxes? The fax system relies on being able to
invoke the PrintTo verb for a given type of object, and if Word is not
present, it cannot do that. The trouble is that I can no longer remember if
it works even if Word (or perhaps the free Word viewer) is present - if for
some reason the file association for .doc is no longer to Word it definitely
would not work anyway.

If you have Word, I suggest you try adapting the code on the page I pointed
to (use the second example for Windows 2003)

Peter Jamieson
 
P

Patel Mitesh

Hi Peter,

Yes i have office 2003 installed in my pc.
And sorry i not get you in the line "If you have Word, I suggest you try
adapting the code on the page I pointed
to (use the second example for Windows 2003)"
So please clarify.

Regards,
Mitesh Patel
 
P

Patel Mitesh

Hi Peter,

I have used the code given by you but still i have same problem that
describe you. So please guide me in this matter.

Thanks & Regards,
Mitesh Patel
 
P

Peter Jamieson

Does the code successfully create a .tif file when it executes

oApp.PrintOut _
Background:=False, _
Append:=False, _
Range:=wdPrintAllDocument, _
OutputFileName:=sTifPath, _
Item:=wdPrintDocumentContent, _
Copies:=1, _
PageType:=wdPrintAllPages, _
PrintToFile:=True

?

(You should be able to find the file in Windows Explorer)

What application is the .tif extension associated with? (e.g. look in
"Windows Explorer"|"Folder Options"|"File types", then look for TIF)? Is a
Printto verb listed in there, and if so, what is the code associated with
that verb?

Peter Jamieson
 
P

Patel Mitesh

Hi Peter,

Actually I made my application in asp.net and as per the link you send me i
try to write the code but i not get the " oApp = new Application" and also
when i used the code given by you for printing the .tif file it prompt me
that "Operation Failed : Printer is not installed on the machine" but the fax
printer is already installed on my machine and also it is shared and also
given the premission (Rights) to asp.net, everyone to full access. I also
check by opeaning the word document and click "File -> send to -> Receipient
to FAX Modem " and the fax wizard is open and able to fax the document . If i
miss something in this than please let me know. I also submit same to asp.net
and vb.net forum of microsoft but yet I not get any reply from them.
 
P

Peter Jamieson

Actually I made my application in asp.net and as per the link you send me
i
try to write the code but i not get the " oApp = new Application" and also

OK, the other way of doing this in VBA is as follows:

Set oApp = CreateObject("Word.Application")

However, I don't know how you do that in asp.net . Also, in theory you
should verify that the object was created.
when i used the code given by you for printing the .tif file it prompt me
that "Operation Failed : Printer is not installed on the machine"

If you have already modified the following line to correspond to your Fax
Printer's name

Const sFaxPrinter = "Fax"

then the only other thing I can suggest is that you may need to alter the
code here, as I suggest (I'm not sure how you could execute this if you had
not managed to set oApp anyway :)


' don't change the printer if it is already
' correctly set up
' (I had problems when I tried to switch
' to the fax printer in code)
' you may need to adjust this for your
' fax printer name
If Left(sActivePrinter, 3) <> sFaxPrinter Then
oApp.ActivePrinter = sFaxPrinter
End If

Peter Jamieson
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top