Hey.. I'm running some vba code to change a certain sheet accordingly
to some information. This sheet then should be faxed to a certain
client, the problem is that Every sheet differs to their respective
client and ther's 500 clients. How will I be able to send every sheet
to it's respectible customer, with the click of one button? I can
already print every sheet with the specific information, but how will I

fax it without having to enter the details of 500 people, can I use a
vbscript file and how do I do that?

Re: I'm tring a VBscripting to send a fax, can someone please help by mr_unreliable

mr_unreliable
Tue Aug 15 12:10:18 CDT 2006

hey Wilken,

Do you have a fax modem on your system?

Do you have fax software installed? Note that some (older) systems
come with fax software, see: programs => accessories => communications
=> send a fax.

This is one of those situations (like magic) whereby to "get the
rabbit out of the hat", you first have to put the rabbit into the
hat. More specifically, even though you don't want to enter
(manually) the information on all those users, you are still
going to have to set up (and maintain) a file with the necessary
information (at a minimum the user name and fax number).

The fax software that I have requires you to enter the faxing
info into textboxes (edit controls). And so, as a "base case"
one would set up a loop, read off the faxing info for a user
enter it into the appropriate textboxes (using appactivate and
sendkeys -- ugh!), and then with another sendkeys click the
button to send off the fax. That's a lot of sending keys, and
unfortunately, the sendkeys command is extrememly unreliable.

I think your best bet would be to find some activeX control that
will do faxing for you. I don't know of any off-hand, but
somebody must have written one. With an actX control, entering
the data and sending the faxes would be much easier and more
reliable than using sendkeys.

cheers, jw
____________________________________________________________

You got questions? WE GOT ANSWERS!!! ..(but,
no guarantee the answers will be applicable to the questions)







Wilken wrote:
> fax it without having to enter the details of 500 people, can I use a
> vbscript file and how do I do that?
>

Re: send fax using microsoft outlook,,, by mr_unreliable

mr_unreliable
Tue Aug 15 12:29:35 CDT 2006

This (vb/vba) code was found was found here:

http://www.vbusers.com/code/codeget.asp?ThreadID=436&PostID=1&NumReplies=0

It is vb code, but looks like it could very easily
be converted to script.

More importantly, if you use this approach you can send faxes
without resorting to sendkeys...

--- <snip> ---
The following code demostrates how to send a fax using Microsoft Outlook.

'Purpose : Sends a fax using Outlook and Microsoft Fax
'Inputs : sFaxNumber The fax number to send the fax to.
' sSubject The fax subject.
' sBody The fax body.
' [sFileName] The file to fax.
'Outputs : Returns an empty string on success, else returns an
error description
'Author : Andrew Baker
'Date : 09/03/2001 14:32
'Notes : Will return a "System Adminstrator" undeliverable
' : message if you do not have Microsoft Fax installed.
'Revisions :

Function OutlookSendFax(sFaxNumber As String, sSubject As String, sBody
As String, Optional sFileName As String) As String
Dim oOutlook As Object 'Outlook.Application
Dim oFax As Object 'Outlook.MailItem

On Error GoTo ErrFailed
Set oOutlook = CreateObject("Outlook.Application")
Set oFax = oOutlook.CreateItem(0) 'olMailItem
With oFax
.To = "[Fax:" & sFaxNumber & "]"
.Subject = sSubject
.Body = sBody
If Len(sFileName) Then
If Len(Dir$(sFileName)) Then
'Add attachment
.Attachments.Add sFileName
End If
End If
.Send
End With

Set oFax = Nothing
Set oOutlook = Nothing

OutlookSendFax = "" 'Return success
Exit Function

ErrFailed:
'Failed, return error description
OutlookSendFax = "Error in OutlookSendFax: " & Err.Description
End Function

'Demonstration routine
Sub Test()
OutlookSendFax "020 7773 1994", "TEST SUBJECT", "TEST BODY",
"c:\myfile.doc"
End Sub
--- </snip> ---

cheers, jw

Re: send fax message using CDO... by mr_unreliable

mr_unreliable
Tue Aug 15 12:49:15 CDT 2006


See Page entitled: "How To Send a Fax Message
with an Attachment Using CDO"

http://support.microsoft.com/kb/q285993/

cheers, jw

Re: Sending faxes using the FAXCOM library. by mr_unreliable

mr_unreliable
Tue Aug 15 13:17:54 CDT 2006

1. You get the faxcom library by installing the Microsoft Fax
Services (on winXP).

Then you can fax a document using the code found here:

http://www.codeguru.com/forum/archive/index.php/t-259837.html

--- <snip> ---
private Sub SendFax()
Dim FaxServ As FAXCOMLib.FaxServer
Dim FaxDoc As FAXCOMLib.FaxDoc

Set FaxServ = New FAXCOMLib.FaxServer
FaxServ.Connect ("MyComputerNameGoesHere")
Set FaxDoc = FaxServ.CreateDocument("C:\fax.tiff")
FaxDoc.FileName = "c:\doctofax.doc"
FaxDoc.FaxNumber = 5555551212
End Sub
--- </snip> ---

Yes, that was vb, but you can convert it to vbs.

Microsoft Fax Service (start page):

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fax/Fax/faxportal_9nol.asp

Microsoft Fax Service Extended COM Object Model:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fax/fax/faxabout_6t2k.asp

cheers, jw


Re: Sending fax using a "fax printer" by mr_unreliable

mr_unreliable
Tue Aug 15 13:19:40 CDT 2006

It is possible to configure a "printer" as a fax.

Then you simply send your document to the "fax printer".

cheers, jw


Re: Sending faxes using the FAXCOM library. by mr_unreliable

mr_unreliable
Tue Aug 15 13:25:34 CDT 2006

ok, the original coder apologizes for the above,
and has re-published a much more rigorous version
here:

http://www.vbnotes.com/Files/FaxSend.zip

cheers, jw

Faxing by Wilken

Wilken
Wed Aug 16 06:21:16 CDT 2006

Thanx for the help, I really appreciate it... I waited almost a week
for someone to help me... You see I will unfortunately have to use the
send keys method. I already have fax software installed (called
LAN-Fax). My boss insist that I use this program and a vb script
method, but I dont really have any idea how to write vbscripts. How
will I be able to run my vba coding from my vb scripttfile?


Calling vba macro from vbScript. by mr_unreliable

mr_unreliable
Wed Aug 16 15:48:16 CDT 2006

Wilken, look up the "Run Method".

You would call it from script, something like this:

Dim oXL : Set oXL = CreateObject("Excel.Application")

With oXL
.Visible = True ' not strictly necessary
.Workbooks.Open sFileName ' open your workbook
.Application.Run "myCustomMacro" arg1,arg2,arg3...
.Application.Quit
End With

cheers, jw

Wilken wrote:
> How will I be able to run my vba coding from my vb scripttfile?