473,387 Members | 1,303 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Sending Fax through VB Code URGENT

92 Expert
Hi programmers...............................

i want to sending fax through vb code it is my client requrement is it possible or not if possible then how can i do?

Please tell me it is urgent........
Oct 3 '06 #1
7 8429
sashi
1,754 Expert 1GB
Hi Hemant,

Kindly refer to below code segment, hope it helps you to get started with, take care my fren.. :)

Expand|Select|Wrap|Line Numbers
  1. Private Declare Function GetComputerName Lib "kernel32" Alias "GetComputerNameA" (ByVal lpBuffer As String, nSize As Long) As Long
  2.  
  3.  
  4. Public Function Fax(ByVal FileName As String, ByVal FaxNumber As String)
  5.     Dim FaxServer As Object
  6.     Dim FaxDoc As Object
  7.     Dim ComputerName As String
  8.     ComputerName = String(50, Chr(0))
  9.     Call GetComputerName(ComputerName, 50)
  10.     ComputerName = Trim(Replace(ComputerName, Chr(0), ""))
  11.     Set FaxServer = CreateObject("FaxServer.FaxServer")
  12.     FaxServer.Connect ("\\" & ComputerName)
  13.     Set FaxDoc = FaxServer.CreateDocument(FileName)
  14.  
  15.  
  16.     With FaxDoc
  17.         .FaxNumber = FaxNumber
  18.         .Send
  19.     End With
  20.  
  21.     Set FaxDoc = Nothing
  22.     Set FaxServer = Nothing
  23. End Function
  24.  
Oct 5 '06 #2
Hi Hemant,

Kindly refer to below code segment, hope it helps you to get started with, take care my fren.. :)

Expand|Select|Wrap|Line Numbers
  1. Private Declare Function GetComputerName Lib "kernel32" Alias "GetComputerNameA" (ByVal lpBuffer As String, nSize As Long) As Long
  2.  
  3.  
  4. Public Function Fax(ByVal FileName As String, ByVal FaxNumber As String)
  5.     Dim FaxServer As Object
  6.     Dim FaxDoc As Object
  7.     Dim ComputerName As String
  8.     ComputerName = String(50, Chr(0))
  9.     Call GetComputerName(ComputerName, 50)
  10.     ComputerName = Trim(Replace(ComputerName, Chr(0), ""))
  11.     Set FaxServer = CreateObject("FaxServer.FaxServer")
  12.     FaxServer.Connect ("\\" & ComputerName)
  13.     Set FaxDoc = FaxServer.CreateDocument(FileName)
  14.  
  15.  
  16.     With FaxDoc
  17.         .FaxNumber = FaxNumber
  18.         .Send
  19.     End With
  20.  
  21.     Set FaxDoc = Nothing
  22.     Set FaxServer = Nothing
  23. End Function
  24.  
I'm trying to do the same thing and this code works fine if I'm running it on the computer that has ms fax services running on it. I have it shared through a company network. I can send faxes by printing them or emailing them but from VB using the code above with the computer name I get an error up sending everytime. RunTime Error '-2147024890 (80070006) Method 'send' of object 'IFaxDoc' failed Any Ideas why?
Nov 1 '06 #3
sashi
1,754 Expert 1GB
Hi there,

Kindly refer to below attached link for further reading & understanding, hope it helps. Good luck & take care.

http://edndoc.esri.com/arcobjects/9....error_handling
Nov 1 '06 #4
In this code Faxserver component is used how to get that component
Mar 23 '07 #5
In this code Faxserver component is used how to get that component
Mar 23 '07 #6
zeuscc
4
Hi, i tried the code that given but i facing an error which is
" Attempted to read or write protected memory. This is often an indication that other memory is corrupt ". Does somebody also facing this problem too?
Feb 23 '08 #7
zeuscc
4
I'm doing my final year project for my degree course. now i'm stuck in how to send the fax.
Feb 25 '08 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Vishal | last post by:
Hello, I already asked this question in the ASP.NET forums, but no help came. So I am hoping that somebody can help me out. This is really very URGENT me. For my e-commerce application, I...
8
by: Mike Owen | last post by:
Hi, I am using the following code to send email on a Windows 2003 Web Server: Imports System.Net.Mail ........ Dim msgmail As New MailMessage msgmail.To.Add(New...
3
by: moondaddy | last post by:
I have some code in a web app (asp.net 2.0) and am trying to send an email to 2 different recipients. The first one works and the second one fails. the first email address is of the same domain as...
0
by: cornish.julia | last post by:
The following code is intended to construct a SYN header and send it to a host (just the localhost at the moment) to form part of a port scanner tool for network security. However, the packet that...
2
by: steve | last post by:
Hi All I need to learn how to update a SQl server or Access database located on a web server from my windows forms application, via the internet I have a customer who wants to run several...
3
by: pradeepdeepu | last post by:
hi, sorry for replying like this.Below is my html code.I need to send all field values to email id.I must do it in PHP,but i don't no php. Please help me by sending code for this html page.It is...
7
by: Paridevi | last post by:
Hai , i want to send email in .Net Using OutLook Express,My Project is Web Application using vb.Net 2003 with SQL Server 2000.I have searched a lot in Google, but ican't get any...
2
by: =?ISO-8859-1?B?RulybmFz?= | last post by:
Hey all, I have a URGENT problem and I hope someone could help me... scenery: I have a windows app, coded using C# (framework 1.1 - VS2003)... The exe and dlls of the app is are stored in a...
2
ThatThatGuy
by: ThatThatGuy | last post by:
Hello reader,, This might be a very simple question, but what to just say about it, i'm facing it Actually i'm developing a web App and i want email feature in that.... I'm sending mail from my...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.