Solved

Selecting fax body format is not working

Posted on 2014-09-06
3
292 Views
Last Modified: 2014-09-08
I am sending a fax using VB6 on win7
if the  .body = "myfile.txt" it works (text file)
any other format are not working
e.g.
if the  .body = "myfile.doc" it is not working
if the  .body = "myfile.html" it s not working
also is there a way to take body from a variable or a text box? because I am injecting names in each send

The followin is my code:-

        Dim objFaxDocument As New FAXCOMEXLib.FaxDocument
        Dim objFaxServer As New FAXCOMEXLib.FaxServer
        Dim objSender As FAXCOMEXLib.FaxSender

        On Error GoTo Error_Handler

        objFaxServer.Connect ("")

        objFaxDocument.Body = "C:\Sal_Jas\Tel_Win\Faxes\Body.txt"
        'objFaxDocument.Body = "C:\Sal_Jas\Tel_Win\Faxes\word2007.doc"
        'objFaxDocument.Body = "C:\Sal_Jas\Tel_Win\Faxes\word1997-2003.doc"
        'objFaxDocument.Body = "C:\Sal_Jas\Tel_Win\Faxes\111.html"

        objFaxDocument.DocumentName = "My First Fax"

        objFaxDocument.Priority = FAXCOMEXLib.FAX_PRIORITY_TYPE_ENUM.fptHIGH

        objFaxDocument.Recipients.Add ("9,22467713")

        objFaxDocument.AttachFaxToReceipt = True

        objFaxDocument.CoverPageType = FAXCOMEXLib.FAX_COVERPAGE_TYPE_ENUM.fcptSERVER
        objFaxDocument.CoverPage = "generic"
        objFaxDocument.Note = "Here is the info you requested"
        objFaxDocument.ReceiptAddress = "someone@example.com"
        objFaxDocument.ScheduleType = FAXCOMEXLib.FAX_SCHEDULE_TYPE_ENUM.fstSPECIFIC_TIME
        objFaxDocument.ScheduleTime = CDate("4:35:47 PM")
        objFaxDocument.Subject = "Today's fax"
        objFaxDocument.sender.Title = "Mr."
        objFaxDocument.sender.Name = "Bob"
        objFaxDocument.sender.City = "Cleveland Heights"
        objFaxDocument.sender.State = "Ohio"
        objFaxDocument.sender.Company = "Microsoft"
        objFaxDocument.sender.Country = "USA"
        objFaxDocument.sender.Email = "someone@microsoft.com"
        objFaxDocument.sender.FaxNumber = "12165555554"
        objFaxDocument.sender.HomePhone = "12165555555"
        objFaxDocument.sender.OfficeLocation = "Downtown"
        objFaxDocument.sender.OfficePhone = "12165555553"
        objFaxDocument.sender.StreetAddress = "123 Main Street"
        objFaxDocument.sender.Tsid = "Office fax machine"
        objFaxDocument.sender.ZipCode = "44118"
        objFaxDocument.sender.BillingCode = "23A54"
        objFaxDocument.sender.Department = "Accts Payable"
        objFaxDocument.sender.SaveDefaultSender
        JobID = objFaxDocument.ConnectedSubmit(objFaxServer)

        MsgBox ("The Job ID is :" & JobID(0))

        objFaxServer.Disconnect

        Exit Sub

Error_Handler:
        MsgBox ("Error number: " & Hex(Err.Number) & ", " & Err.Description)
0
Comment
Question by:saljas
  • 2
3 Comments
 
LVL 32

Accepted Solution

by:
Robberbaron (robr) earned 500 total points
ID: 40308045
from MSDN...
Examples of documents that you can send as a fax body are a text file (.txt), a Microsoft Word document (.doc), or a Microsoft Excel spreadsheet (.xls). When you send a fax from a client computer, the body has to be associated with an application that is installed on that computer, and the application has to support the PrintTo verb; otherwise, the fax will fail.

so need to be sure that the file type has a valid PrintTo on every machine that will send fax; often a problem on a server as Office can cause issues if installed.

also have a look at http://www.interfax.net/en/dev/faxcomexlib where a number of common issues are discussed.
0
 

Author Comment

by:saljas
ID: 40308553
Many thanks for your help
First
Yes I already read MSDN, and that is why I am trying to use (FAXCOMEXLib.dll).
If microsoft says (.doc) and (.xls) then there is no need that I check wether word or excell support PrintTo or no.
Or maybe I missunderstood you?

Secound
Regarding the link you have sent, it is confusing - it referes to FAXCOMEXLib.dll which is found within VB6 refarance list, and at the same time they say (InterFAX allows you to send faxes programmatically) as if they are trying to sell there product (InterFAX).   I mean on one hand they talk about MS product - on the other - they have their product so reading the explanation they provide might not be for the dll I am using!! or what

regard
0
 
LVL 32

Expert Comment

by:Robberbaron (robr)
ID: 40309391
You do need to check that the print handler is installed for each file type, sometimes gets removed.
The link is just to a page of examples.

The text file works so I think it is the print to handlers for other file types that is the issue.
I once has to install acrobat 6 ( when 8 was current ) as it had a print handler that did not display a settings box everytime
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

708 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now