473,772 Members | 2,272 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Faxing

Hi all
I want to send a fax with WebService in vb.net; I use this code to send a fax with FaxService in Windows XP

Dim FXServ As New FAXCOMLib.FaxSe rve
Dim FXDoc As FAXCOMLib.FaxDo
Dim iFaxJob As Intege

FXServ.Connect( "\\localhos t"

FXDoc = CType(FXServ.Cr eateDocument("C :\fax.doc"), FAXCOMLib.FaxDo c

FXDoc.FileName = "C:\fax.doc
FXDoc.FaxNumber = "005056
FXDoc.SenderNam e = "Fax Test
FXDoc.DisplayNa me = "Test

iFaxJob = FXDoc.Send(

FXServ.Disconne ct(

This code works well in Windows Forms but in Web Forms or in a WebService don’t work. I try different configurations of security, put the code in another assembly and generate a Wrapper for the FAXComLib class as explained in http://support.microsoft.com/default...;en-us;q303647 without any result

Anybody can help me? Thanks in advance

Regard
Joan

Nov 20 '05 #1
2 1827
I am having a similar problem with a Win32 Service (not WebService)...w hen I run application as stand-alone exe the fax sends fine using the same code you have above, however, when I attempt to run as a service the FXDoc.Send() line hangs indefinately. The same behaviour is seen using FXServer.Connec tedSubmit and FXServer.Commit ...I suspect the problem is as follows: When you create a service (Windows or Web), you may include no UI, however, when you try to fax using any method described above you create an instance of Word (or WordPad, or Acrobat, or whatever, depends on document being printed)...sinc e each of these apps have a UI (often you see "printing page X of Y to Fax" window, or the actual document load) I believe the faxing fails...

Sadly I have yet to find a workaround :-(
I am now attempting to fax directly to the FaxMachine's DC using FaxStartPrintJo b (in winfax.dll), but am having vast problems converting the C types to VB...If anyone can help in this endevour it would be greatly appreciated...o nce I have this resolved I will post code snippet here.
Nov 20 '05 #2
Joan et all,
I was able to re-create your problem (if your service, indeed, appears to hang on the 'FXDoc.Send()' line of code
(NOTE: you can test this by putting debug lines before and after the line which print some message to an ASCII file. Please don't forget to close your debugging file BEFORE your 'FXDoc.Send()' line executes! You could also use the EventLog success-audit stuff). (Incidently, I do not believe your code (as listed) will work on Win2K machines, which is how this nightmare began for me)...Here's the ONLY work-around I could find (and I tried quite a few, see previous post):
[Note: Using MSFax from XP, and W2K disks]
I believe one needs to call FaxStartPrintJo b API to obtain a Device Context for the faxing job (you also set routing info when you call this API). Once you have successfully called FaxStartPrintJo b (non-zero return code), [then FaxPrintCoverPa ge] you may freely use GDI (and GDI+ I immagine) functionality to send your fax. I cannot seem to send an associated file via service at all (like your .doc file). I believe it has to do with the UI that the associated program uses, but I'm not certain (like Word or Wordpad, whichever handles your server's .doc's). Personally, I hated coding this, it was tedious, and much more code than I needed to send a fax while not running as a service (Win32 or Web). The ONLY benefit I see from the previously described code is it works on both XP and Win2K...If anyone has any alternatives please let us know!!

For additional information on Faxing directly to a device context (unfortunately only talks about C++, but works in VB.Net and VB6) see:
http://msdn.microsoft.com/library/de...egacy_1rzo.asp
(also do not forget to call EndDoc AND DeleteDC NEVER freeDC!!)
Nov 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1848
by: MCL | last post by:
Anybody done this before... I have found a few through web searches but not many... Anybody know of a com object or anything that interfaces with ASP to allow the faxing of messages and web pages from a web page... Thanks, Mark
0
1103
by: Alex Stevens | last post by:
Hi All, We are looking for a faxing component, which we can drop into an application which would allow the user to send faxes through a faxmodem attached or a shared network modem. We've previously used the winfax product, but due to their lack of support (nil) we can't progress with it. We would like to be able to send a fax, and be able to get the status of the
4
1929
by: Bob | last post by:
I was wondering what would be the easiest way to fax a document from within a Windows .NET application. It's not enough to simple print to a fax service device. I want to be able to pass the fax number so I can create a loop that will send the fax to a bunch of different numbers. If there is a third party tool that will do this, I would consider that option. Thanks in advance for any help.
0
1768
by: Sam Coburn | last post by:
I want to automate faxing from access 2000 so it'll use the customer's name and fax number to automatically fax to several customers a report. How can I do this or can you point me in the right direction? Thanks.
0
1365
by: sachin | last post by:
Hi I am trying to implement faxing through asp.net application on Windows 2000 server. It works when i send a .txt file, but hangs when trying a word or a pdf document. Any idea what the problem might be..? I am running it under the "SYSTEM" account so i dont think its the permissions issue. After a lot of debugging i have found that it returns a "data is invalid"
0
1009
by: CS | last post by:
Hi all, This is what I am trying to achieve. I am writing a web application to allow my users to submit their documents for faxing. I have tested it using bmp and txt file and both seems to be ok. When I try to test with excel of word document, it gives me error. From the applicaiton event log, noticed that there are some messages on msiinstaller couldn't find some keys in the HKEY_CURRENT_USER registry. From the task manager I noticed...
2
1823
by: willl69 | last post by:
Hi, I was just wondering if anyone knows if its possible to set up some sort of remote faxing server using PH P & apache. If not, any other prog languages or server technologies? I know .NET can do it by using the windows faxing service but i am looking for an alternative. Cheers
0
1470
by: crazytegger | last post by:
Hi, I have an access report that has 2 different images on it. One is embedded, and one is a linked image. The report prints to a local printer just fine. When I try to fax the report (using WinFax) it comes through all right but the 2 images are not on the fax. I tried importing both images into a word doc and faxing them and that worked just fine. Is there something im missing?? some property that needs to be set in order to transmit these...
1
1090
by: Diffident | last post by:
Hello All, We would like to add faxing capabilities to our application. We need to fax PDF attachments that are generated on-the-fly. Does any one know of any third party tools that have this capability and can be integrated with .NET 1.1 and ..NET 2.0? Thanks!!
0
9620
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9454
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10104
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9912
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7460
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6715
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5482
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4007
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2850
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.