[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Faxing a Word Document

Posted on 2003-11-24
5
Medium Priority
?
287 Views
Last Modified: 2010-04-17
Hi experts,
     How can I FAX a Word document? If anyone provide some code, it will be very helpful.
     
     I have the fax number and the word document, faxing should be done in silent mode, becoz user may work in that machine.

Rosh :)
0
Comment
Question by:Roshan Davis
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 8

Accepted Solution

by:
SNilsson earned 2000 total points
ID: 9816350
If you have outlook installed you can do it in word VBA like this:

Function SendOutlookFax(strFaxNumber As String, strSubject As String, strBody As String, Optional strFileName As String) As String
    Dim objOutlook As Object
    Dim objFax As Object
     
    On Error GoTo ErrCheck

    Set objOutlook = CreateObject("Outlook.Application")
    Set objFax = objOutlook.CreateItem(0)

    With objFax
        .To = "[Fax:" & strFaxNumber & "]"
        .Subject = strSubject
        .Body = strBody
        If Len(strFileName) Then
            If Len(Dir$(strFileName)) Then
                .Attachments.Add strFileName
            End If
        End If

        .Send

    End With
     
    Set objFax = Nothing
    Set objOutlook = Nothing
     
    SendOutlookFax = "" 'Return success
    Exit Function

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


And you call the routine like this:
Sub Test()
    SendOutlookFax "0208 456 7890", "TEST SUBJECT", "TEST BODY", "testfile.txt"
    'This is NOT a valid number as far as I am aware!!!!
End Sub
0
 
LVL 23

Author Comment

by:Roshan Davis
ID: 9816608
Thankx for your comment, is there any other methods without outlook.
And also can send .DOC format
Rosh :)
0
 
LVL 23

Author Comment

by:Roshan Davis
ID: 9822524
Hi SNilsson,

If I specify a .DOC file in that function "SendOutlookFax", will that work without Showing the Word document....?
My problem is, the present code is showing the Word Document while sending... :(

Rosh :)
0
 
LVL 23

Author Comment

by:Roshan Davis
ID: 9822635
Hi SNilsson,

I checked your code, sounds interesting.... Can you tell something about its dependency..

Rosh :)
0
 
LVL 8

Expert Comment

by:SNilsson
ID: 9822802
Hi Rosh,

I have not actually used the code above, found it in a dusty 'good to have' folder.
As for dependency what I can see it's only Outlook.Application (you can change that to early binding of course).

I belive that the word document must be opened to be faxed, but you could use the visible setting on the application to hide it, or just minimize.

GL
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is about my first experience with programming Arduino.
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
Simple Linear Regression
Introduction to Processes

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question