Fax Software

Community Forums

This topic contains 7 replies, has 0 voices, and was last updated by  Anonymous 16 years, 8 months ago.

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #2689

    daverch
    Member

    Set objWinfaxSend = Server.CreateObject(“WinFax.SDKSend”)
    objWinfaxSend.SetCoverText desc
    objWinfaxSend.SetSubject “Invoice ” & InvId
    objWinfaxSend.SetCountryCode “”
    objWinfaxSend.SetAreaCode “”
    objWinfaxSend.SetNumber Request.Form(“Email”)
    objWinfaxSend.SetTo oObject(“CusName”)
    objWinfaxSend.MakeAttachment(“c:redbackwebipindex.htm”)
    objWinfaxSend.AddRecipient
    objWinfaxSend.Send 0
    Set objWinfaxSend = Nothing

    #4559

    Anonymous
    Member

    If you are using IE, this will not work since it will prompt you with a print dialog. You will need to print html using the printer driver + web browser control.
    or, you can use Netscape instead.

    #4560

    daverch
    Member

    I changed to code as follows and it converts the output. However, I get prompted on the console for the printer to print to:
    Set objWinfaxSend = Server.CreateObject(“WinFax.SDKSend8.0”)
    objWinfaxSend.SetCoverText “Invoice Attached”
    objWinfaxSend.SetSubject “Invoice ” & InvId
    objWinfaxSend.SetDeleteAfterSend 1
    objWinfaxSend.SetCountryCode “”
    objWinfaxSend.SetAreaCode “”
    objWinfaxSend.SetNumber Request.Form(“Email”)
    objWinfaxSend.SetTo oObject(“CusName”)
    objWinfaxSend.AddAttachmentFile “c:tempfax.htm”
    objWinfaxSend.AddRecipient
    objWinfaxSend.Send 0
    objWinfaxSend.Done
    Set objWinfaxSend = Nothing

    #4561

    Anonymous
    Member

    Are you using IE as your Web browser?? if so, it will always show the print dialog box.

    #4562

    kiwi
    Member

    Re: Internet Explorer always asking for the print dialog to send html, this isn’t necessarily true. Through OLE you can ask Internet Explorer to print without user interaction. Here’s the pseudocode:

    IWebBrowser2.ExecWB(IDM_PRINT, OLECMDEXECOPT_DONTPROMPTUSER);

    I’m not an OLE guru — is there a way to modify the WinFax method so it uses this nice convenient ‘Dont Prompt User’ option?

    #4563

    Anonymous
    Member

    yes this will work, but in this case you are not adding as an attachment, you are printing to the Winfax driver directly instead.

    winfax uses the “Print To” method to add attachments on the fly, this is the same as right-clicking a file and selecting print. (You can do this for associated files, like .TXT, .DOC, HTML etc.) In the case for HTM files (when IE is the associated program) , the “Print” dialog appears and there is no way around this if you plan on using this method.

    #4564

    kiwi
    Member

    Hi all.

    Ok really simple thing then.. I tried using Winfax with an HTML attachment in VBA from Word (since VBA is virtually identical to VB) but with no success.

    Here’s the code, I have hooked up to a button in Word:

    Private Sub TestFax_Click()
    Set objWinfaxSend = CreateObject(“WinFax.SDKSend”)
    objWinfaxSend.SetCoverText “Invoice Attached”
    objWinfaxSend.SetSubject “Invoice ” & InvId
    objWinfaxSend.SetDeleteAfterSend 1
    objWinfaxSend.SetCountryCode “”
    objWinfaxSend.SetAreaCode “”
    objWinfaxSend.SetNumber “whatever”
    objWinfaxSend.SetTo “CusName”
    objWinfaxSend.AddAttachmentFile “C:test.html”
    objWinfaxSend.AddRecipient
    ret = objWinfaxSend.Send(0)
    ‘ was there an error?
    If ret <> 0 Then
    MsgBox “There was an Error”, vbOKOnly
    Else
    MsgBox “Fax has been sent!”, vbInformation
    End If
    objWinfaxSend.Done
    Set objWinfaxSend = Nothing

    End Sub

    I tried WinFaxSDK.Send and the same with 8.0 on the end to the same effect: Netscape 6.2’s splash screen appears but then WinFax says ‘printing failed you have to launch the app and choose print yourself’…

    Anyone had any luck with Netscape 6.2? I have the same problems with Mozilla 0.9.9…

    BTW some background: I ultimately don’t want to do this in Word, I will be doing it in Java with the JACOB bridge but I wanted to check that it worked from VB first and then translate it (Jacob is JVM-independent API for supporting Microsoft extensions for java).

    #4565

    Anonymous
    Member

    Try this:

    Private Sub TestFax_Click()
    Set objWinfaxSend = CreateObject(“WinFax.SDKSend”)
    objWinFaxSend.ClientID(“WinFax”)
    objWinfaxSend.SetCoverText “Invoice Attached”
    objWinfaxSend.SetSubject “Invoice ” & InvId
    objWinfaxSend.SetDeleteAfterSend 1
    objWinfaxSend.SetCountryCode “”
    objWinfaxSend.SetAreaCode “”
    objWinfaxSend.SetNumber “whatever”
    objWinfaxSend.SetTo “CusName”
    objWinfaxSend.AddAttachmentFile “C:test.html”
    objWinfaxSend.AddRecipient

    ret = objWinfaxSend.Send(1)
    ‘ was there an error?
    If ret <> 0 Then
    MsgBox “There was an Error”, vbOKOnly
    Else
    MsgBox “Fax has been sent!”, vbInformation
    End If

    ‘ Wait until the EntryID is ready before moving on.
    ‘ the Send(1) you specified before is used here.
    ‘ We don’t care what the EntryID is,
    ‘ we just want to know that is it ready.
    ‘ this loop will wait but allow background processing to continue
    ‘ when ready IsEntryIDReady is not = to 1

    Do While objWinFaxSend.IsEntryIDReady(0) <> 1
    DoEvents
    Loop

    objWinfaxSend.Done
    Set objWinfaxSend = Nothing

    End Sub
    [/quote]

Viewing 8 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic.