Fax Software

Community Forums

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #2558
    robsmith439
    Member

    Using a VB6 program, I would like to be able to convert from the Winfax proprietary format to a non proprietary format such as TIFF (or even PCX or DCX… or…). I have found the WinFax.SDKFXConverter and even sample code (thanks to this wonderful site).

    BUT….

    I can’t seem to figure out how to save a multipage winfax file into a set of single page images or into a multipage file. The ConvertFromFX method seems to just store the first page into the target file.

    The ConvertFromFXToPage allows you to save to a multipage target file, but again it seems like only the first page of the FX file is being saved.

    There *must* be a way to save all the pages of a winfax file into one or more target files, right??

    Please help!!!

    Thanks

    #4315
    manciaux
    Member

    I had the same problem. This program seems to work

    Public Sub SaveFaxFile(strTargetFile As String)

    Dim oLog As Object ‘wfxctl32.CSDKLog
    Dim oConverter As Object ‘ wfxctl32.CSDKFXConverter
    Dim strFolderName As String
    Dim strFolderID As String
    Dim strMessageID As String
    Dim strFileName() As String
    Dim strFilePath As String
    Dim strFileID As String
    Dim intPage As Integer
    Dim varResult As Variant

    Dim intTargetFolder As Integer

    Const STANDARDFOLDER_WINFAX_OUTBOX = 6
    Const STANDARDFOLDER_WINFAX_LOG = 2
    Const STANDARDFOLDER_WINFAX_SENDLOG = 4

    On Error GoTo SaveFaxFile_err

    intTargetFolder = STANDARDFOLDER_WINFAX_SENDLOG
    Const LogName = “Send Log”

    Set oLog = CreateObject(“Winfax.SDKLog”)
    Set oConverter = CreateObject(“Winfax.SDKFXConverter”)

    ‘ find the correct folder – iterate through the list since we can’t beu sure of the order
    strFolderID = oLog.GetFolderListFirst(STANDARDFOLDER_WINFAX_LOG, “”)
    Do Until (oLog.GetFolderDisplayName(strFolderID) = LogName) Or (strFolderID = “”)
    strFolderID = oLog.GetFolderListNext
    Loop

    If oLog.GetFolderDisplayName(strFolderID) = LogName Then
    ‘ we get the first message (we are assuming the outbox has only 1 item in it
    strMessageID = oLog.GetMessageListFirst(intTargetFolder, “”)
    If (Len(strMessageID) > 0) Then
    ‘ get the file names and use the converter to add them to a multi-page fxs file
    strFileName = Split(oLog.GetMessageFirstFile(strFolderID, strMessageID), “|”)
    oConverter.Format = 10
    oConverter.BitsPerPixel = 1
    Do Until UBound(strFileName) 3
    strFilePath = strFileName(1) & strFileName(0)
    If Dir$(strFilePath) “” Then
    intPage = intPage + 1
    varResult = oConverter.ConvertFromFXToPage(strFilePath, strTargetFile, intPage)
    Debug.Print varResult

    End If
    strFileName = Split(oLog.GetMessageNextFile(), “|”)
    Loop
    End If
    End If

    SaveFaxFile_Exit:
    Exit Sub
    SaveFaxFile_Error:
    If oError.Handle(MY_NAME & “_” & “SaveFaxFile”) Then Stop: Resume
    Resume SaveFaxFile_Exit
    End Sub

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