Forum Replies Created
-
AuthorPosts
-
April 23, 2002 at 6:10 pm in reply to: ConvertFromFX multipage – possible? how? – ConvertFromFX multipage – possible? how? #4315manciauxMember
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 VariantDim intTargetFolder As Integer
Const STANDARDFOLDER_WINFAX_OUTBOX = 6
Const STANDARDFOLDER_WINFAX_LOG = 2
Const STANDARDFOLDER_WINFAX_SENDLOG = 4On 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
LoopIf 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 varResultEnd If
strFileName = Split(oLog.GetMessageNextFile(), “|”)
Loop
End If
End IfSaveFaxFile_Exit:
Exit Sub
SaveFaxFile_Error:
If oError.Handle(MY_NAME & “_” & “SaveFaxFile”) Then Stop: Resume
Resume SaveFaxFile_Exit
End Sub -
AuthorPosts