Fax Software

Community Forums

  • This topic is empty.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
  • #2691

    Here is an example of using MakeAttachment.

    Dim objWinFaxSend As Object
    Dim objWinFaxAttach As Object

    Set objWinFaxSend = CreateObject(“WinFax.SDKSend8.0”)
    Set objWinFaxAttach = CreateObject(“WinFax.Attachment”)

    objWinFaxSend.SetClientID (“Client Name”)

    Dim objWord As Object
    Set objWord = CreateObject(“Word.Application”)
    ‘ Have Word appear on the screen?
    objWord.Application.Visible = True

    ‘ replace this with a valid Microsoft Word document.
    objWord.Application.Documents.Open “c:windowsscript.doc”

    ‘ change some settings in Word (not required)
    objWord.Application.Selection.Font.Name = “Courier New”
    objWord.Application.Selection.Font.Size = 8

    RetCode = objWinFaxSend.SetPrintFromApp(1)
    ‘ create attachment filename “Filexxx.fxs” and save to root
    ‘ directory of c: drive.
    RetCode = objWinFaxSend.MakeAttachment(“file”, “C:”, 0)

    ‘ Get the original printer settings before altering them.
    OldPrinter = objWord.Application.ActivePrinter

    ‘ Set the active printer to WinFax PRO printer driver.
    ‘ Note: This code only tested in Windows 9x, different printer code may be required
    ‘ for Windows 2000 and Windows NT.
    objWord.Application.ActivePrinter = “WinFax on FaxModem”

    ‘ print the current document in Word to WinFax.

    ‘ Set Printer back to original settings.
    objWord.Application.ActivePrinter = OldPrinter

    ‘Close Active document in Word 2000
    objWord.ActiveDocument.Close SaveChanges:=wdDoNotSaveChanges
    ‘ Close instance of MS Word
    objWord.Application.Quit SaveChanges:=wdDoNotSaveChanges

    Set objWord = Nothing

    objWinFaxAttach.SetDescription (“Attachment Example”)
    objWinFaxAttach.SetFileName (“c:file001.fxs”)

    Set objWinFaxSend = Nothing
    Set objWinFaxAttach = Nothing


    This is fine for the VB and MS Word, but if i want to print from my program itself then it does’n work.
    I am doing the same using VC++ and Using Printer device context to print on WinFax Driver.
    If i do both the initialization setting of SDKSend object and Printing on printer driver then it doesn’t work while it work’s if i do these both the task from two different instance of my application.
    Please tell me the solution, i am in urgent need.

    Thax in advance.



    Any news on this? I recently upgraded WinFax to 10.02 to use with XP only to find this issue or something v. similar. My app runs fine with 10.02 on 2000 but same code on XP (using SDK CSDKSend object) ends up hanging after WinFax has accessed Word and printed the doc I want it to send. I noticed a similar issue posted on the Symantec hosted forum.


    You probably want to take a look at this thread. The problem looks to be 10.02 specifically with Windows XP. I am not aware of any fix at this time



    just a quick question regarding adding attachments. What if the word document is over 1 page? How do we add the attachment in this case? does each addattachment add a new attachment?




    if its more than one page a file is generated for each page. It appends 001, 002 , 003 etc to each filename. For example, myfax001.fxs, myfax002.fxs …

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.