Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Mailmerge and Fax / March 2007

Tip: Looking for answers? Try searching our database.

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

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Patel Mitesh - 07 Mar 2007 09:55 GMT
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
Peter Jamieson - 07 Mar 2007 11:30 GMT
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

> Hi All,
>
[quoted text clipped - 14 lines]
>
> Mitesh Patel
Patel Mitesh - 07 Mar 2007 11:46 GMT
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 mitesh@rangam.com. 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

> You forgot to include your code.
>
[quoted text clipped - 32 lines]
> >
> > Mitesh Patel
Peter Jamieson - 07 Mar 2007 12:14 GMT
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

> Hi, Peter
>
[quoted text clipped - 100 lines]
>> >
>> > Mitesh Patel
Patel Mitesh - 07 Mar 2007 12:25 GMT
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

> 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
[quoted text clipped - 113 lines]
> >> >
> >> > Mitesh Patel
Peter Jamieson - 07 Mar 2007 12:55 GMT
I meant: Have a look at

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

and specifically look at the second Sub on that page, i.e.

Sub MergeOneFaxPerSourceRecEx()

because the first one probably will not work with Windows 2003

Peter Jamieson
> Hi Peter,
>
[quoted text clipped - 136 lines]
>> >> >
>> >> > Mitesh Patel
Patel Mitesh - 07 Mar 2007 16:37 GMT
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

> I meant: Have a look at
>
[quoted text clipped - 147 lines]
> >> >> >
> >> >> > Mitesh Patel
Peter Jamieson - 07 Mar 2007 17:15 GMT
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

> Hi Peter,
>
[quoted text clipped - 169 lines]
>> >> >> >
>> >> >> > Mitesh Patel
Patel Mitesh - 08 Mar 2007 07:45 GMT
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.

> Does the code successfully create a .tif file when it executes
>
[quoted text clipped - 192 lines]
> >> >> >> >
> >> >> >> > Mitesh Patel
Peter Jamieson - 08 Mar 2007 09:28 GMT
> 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

> Hi Peter,
>
[quoted text clipped - 224 lines]
>> >> >> >> >
>> >> >> >> > Mitesh Patel
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.