Fax Software

Community Forums

Forum Replies Created

Viewing 15 posts - 1,246 through 1,260 (of 1,288 total)
  • Author
    Posts
  • Anonymous
    Member

    you can use the IsEntryIDReady to determine if WinFax returns an entry id. then you can terminate the Sendobject.

    in reply to: SDK with 2 Html problem ? #4432
    Anonymous
    Member

    the only way to do this would be to attach command to add the html file, but the problem is that if you are using Internet Explorer it will pop up the print dialog box. The workaround is to use netscape instead.

    in reply to: SDKSend Initialization – JustFax vs my app #4304
    Anonymous
    Member

    Ignore this one too

    (Edited by alexmcmorris at 3:42 pm on Nov. 5, 2001)

    Anonymous
    Member

    This is the code we use. The information is read from a file. Thank you for looking at it. I tried to follow some of the examples.

    Private Sub SendWinFaxes()

    Dim attachsObj As Object
    Dim DocPath As String
    Dim SendObj As Object
    Dim Ret As Integer
    Dim ErrorCode As Long
    Dim FileNum As Integer
    Dim FaxNumber As String
    Dim Idx As Long
    Dim AreaCode As String
    Dim PhoneNumber As String
    Dim Countrycode As String
    Dim ReturnCode As Integer
    Dim colTestFiles As Collection
    Dim FilePath As Variant
    Dim StartTime As Single
    Dim TestTime As Single
    Dim PrinterObj As Printer
    Dim OriginalPrinter As String

    On Error GoTo SendWinFaxesError

    If FileLen(mvFaxControlFile) = 0 Then
    Err.Raise enmElectronicDocErrors.eElectronicDocNoFaxControlFile
    End If

    If Not SendObj Is Nothing Then Set SendObj = Nothing
    ‘Instantiate Send Object
    Set SendObj = CreateObject(“WinFax.SDKSend”)
    SendObj.SetClientID (“Client Name”)

    If Not attachsObj Is Nothing Then Set attachsObj = Nothing

    Set attachsObj = CreateObject(“WinFax.Attachments”)

    If SendObj Is Nothing Then
    Err.Raise enmElectronicDocErrors.eElectronicDocWinProComponentNotFound
    End If

    If attachsObj Is Nothing Then
    Err.Raise enmElectronicDocErrors.eElectronicDocWinProComponentNotFound
    End If

    CleanupFaxTempFiles

    ‘— In order to pretest the control file for errors
    ‘— We will only activate the send on the second time
    ‘— through the loop.
    For Idx = 0 To 1

    ‘— Remember the files created on the test run and delete them
    ‘— before the real run.

    If mvLogging Then
    WriteToLogFile “WinFaxLog.TXT”, ” Start time ” & Now()
    End If

    ‘— Clean up the files created on test run.
    If Idx = 0 Then
    Set colTestFiles = New Collection
    Else
    For Each FilePath In colTestFiles
    mvoFSO.DeleteFile FilePath
    Next
    Set colTestFiles = Nothing
    If mvLogging Then
    WriteToLogFile “WinFaxLog.TXT”, ” After deleting files – 2 ” & Now()
    End If
    End If

    FileNum = FreeFile()
    If FileNum = 1 Then FileNum = 8

    ‘Open the control file
    Open mvFaxControlFile For Input As FileNum

    If mvLogging Then
    If Idx = 0 Then
    WriteToLogFile “WinFaxLog.TXT”, ” *** Starting WinFax Test Run *** “
    Else
    WriteToLogFile “WinFaxLog.TXT”, ” *** Starting WinFax Transmitting Run *** “
    End If
    End If

    Do
    ‘Clear variables
    BlankProperties
    If mvLogging Then
    WriteToLogFile “WinFaxLog.TXT”, ” After BlankProperties ” & Now()
    End If

    ‘BlankProperties is called elsewhere so don’t add the following
    FaxNumber = “”
    AreaCode = “”
    mvFaxSendDate = “”
    mvFaxSendTime = “”
    mvFaxPriority = 2
    mvDocPath = “”
    PhoneNumber = “”

    If mvLogging Then
    WriteToLogFile “WinFaxLog.TXT”, ” Before Input # Statement” & Now()
    End If

    ‘Read the fax control record into property variables
    Input #FileNum, mvDestinationType, mvDestinationID, _
    mvFaxNumber, mvFaxName, _
    mvFaxCompany, mvFaxCityState, _
    mvFaxSendDate, mvFaxSendTime, mvFaxPriority, mvMessage, _
    mvDocPath

    If mvLogging Then
    WriteToLogFile “WinFaxLog.TXT”, “1st DocPath = ” & mvDocPath
    End If
    ‘— Copy the RTF file as a DOC file in a Temp directory, if needed as a Winfax work around.
    ‘— Note: Set mvUsingDocExtension to true for now. Later we can add a system configuration
    ‘— keyword that is set in FDCFG, if we need to be able to process files as RTF or DOC.
    mvUsingDocExtension = True

    If mvUsingDocExtension Then
    DocPath = mvDocPath
    mvDocPath = “”
    mvDocPath = CreateUniqueTempWinFaxFile(DocPath)
    End If

    If Idx = 0 Then colTestFiles.Add mvDocPath

    If mvLogging Then
    WriteToLogFile “WinFaxLog.TXT”, ” 2nd DocPath when converted to temp dir = ” & mvDocPath
    End If
    ‘Load the properties of WinFax send object

    ‘ Countrycode
    ‘— When we support faxing to other countries, this will have to be changed
    ‘— At this time its not clear where it will be stored
    Countrycode = “1”

    If Countrycode <> “1” Then
    ReturnCode = 0
    ReturnCode = SendObj.SetCountryCode(Countrycode)
    If ReturnCode = 1 Then
    Err.Raise enmElectronicDocErrors.eElectronicDocInvalidCountryCode
    ReturnCode = 0
    End If
    End If

    If mvLogging Then
    WriteToLogFile “WinFaxLog.TXT”, “Fax Number ” & mvFaxNumber
    End If

    ‘— Verify that the control file and the Attachment have the same phone number
    If Not CheckPhoneNumber() Then
    Err.Raise enmElectronicDocErrors.eElectronicDocInvalidAttachFile
    ReturnCode = 0
    End If

    ‘AreaCode
    If Len(mvFaxNumber) = 10 Then
    AreaCode = Left&#36(mvFaxNumber, 3)
    End If

    If Len(AreaCode) = 3 Then
    ReturnCode = SendObj.SetAreaCode(AreaCode)
    If ReturnCode = 1 Then
    Err.Raise enmElectronicDocErrors.eElectronicDocInvalidAreaCode
    ReturnCode = 0
    End If
    End If

    ‘PhoneNumber
    PhoneNumber = Right&#36(mvFaxNumber, 7)
    If Len(PhoneNumber) = 0 Then
    Err.Raise enmElectronicDocErrors.eElectronicDocInvalidPhoneNumber
    End If

    ReturnCode = SendObj.SetNumber(PhoneNumber)
    If ReturnCode = 1 Then
    Err.Raise enmElectronicDocErrors.eElectronicDocInvalidPhoneNumber
    ReturnCode = 0
    End If

    If mvLogging Then
    WriteToLogFile “WinFaxLog.TXT”, “Fax Number ” & mvFaxNumber
    WriteToLogFile “WinFaxLog.TXT”, “Area Code ” & AreaCode
    WriteToLogFile “WinFaxLog.TXT”, “Phone Number ” & PhoneNumber
    End If

    ‘ Leave running
    ReturnCode = SendObj.LeaveRunning()
    If ReturnCode = 1 Then
    If Ret <> 0 Then
    Err.Raise enmElectronicDocErrors.eElectronicDocSendError
    End If
    End If

    ‘ Recipients name
    ReturnCode = SendObj.SetTo(mvFaxName)
    If ReturnCode = 1 Then
    Err.Raise enmElectronicDocErrors.eElectronicDocInvalidRecipient
    ReturnCode = 0
    End If

    ‘ Recipients company
    ReturnCode = SendObj.SetCompany(mvFaxCompany)
    If ReturnCode = 1 Then
    Err.Raise enmElectronicDocErrors.eElectronicDocInvalidCompany
    ReturnCode = 0
    End If

    ‘ Send Time
    If Len(“” & mvFaxSendTime) > 0 Then
    ReturnCode = SendObj.SetTime(CDate(mvFaxSendTime))
    If ReturnCode = 1 Then
    Err.Raise enmElectronicDocErrors.eElectronicDocInvalidSendTime
    ReturnCode = 0
    End If
    End If

    ‘ Send date
    If Len(“” & mvFaxSendDate) > 0 Then
    ReturnCode = SendObj.SetDate(mvFaxSendDate)
    If ReturnCode = 1 Then
    Err.Raise enmElectronicDocErrors.eElectronicDocInvalidSendDate
    ReturnCode = 0
    End If
    End If

    ‘ Send Priority
    If Len(“” & mvFaxPriority) > 0 Then
    ReturnCode = SendObj.SetPriority(mvFaxPriority)
    If ReturnCode = 1 Then
    Err.Raise enmElectronicDocErrors.eElectronicDocInvalidPriority
    ReturnCode = 0
    End If
    End If

    ReturnCode = SendObj.SetResolution(1)
    If ReturnCode = 1 Then
    If Ret <> 0 Then
    Err.Raise enmElectronicDocErrors.eElectronicDocSendError
    End If
    End If

    ‘Subject
    ReturnCode = SendObj.SetSubject(mvSubject)
    If ReturnCode = 1 Then
    Err.Raise enmElectronicDocErrors.eElectronicDocInvalidSubject
    ReturnCode = 0
    End If

    ‘ Delete after send so attachments collection does not grow too big.
    ReturnCode = SendObj.SetDeleteAfterSend(1)
    If ReturnCode = 1 Then
    If Ret <> 0 Then
    Err.Raise enmElectronicDocErrors.eElectronicDocSendError
    End If
    End If

    ‘ Send Quick Cover
    ReturnCode = SendObj.SetQuickCover(1)
    If Len(“” & mvMessage) > 0 Then
    ReturnCode = SendObj.SetCoverText(mvMessage)
    If ReturnCode = 1 Then
    Err.Raise enmElectronicDocErrors.eElectronicDocInvalidQuickCover
    ReturnCode = 0
    End If
    End If

    ‘Attachment
    ReturnCode = SendObj.AddAttachmentFile(mvDocPath)
    If ReturnCode = 1 Then
    Err.Raise enmElectronicDocErrors.eElectronicDocInvalidAttachFile
    ReturnCode = 0
    End If

    ‘Add Recipent
    If SendObj.AddRecipient() = 1 Then
    Err.Raise enmElectronicDocErrors.eElectronicDocInvalidRecipient
    End If

    ‘— don’t send for the trial run idx = 0 just see if there are errors
    If Idx = 1 Then
    ‘ okay, lets go!
    Ret = SendObj.Send(1)
    ‘ was there an error?
    If Ret <> 0 Then
    Err.Raise enmElectronicDocErrors.eElectronicDocSendError
    End If
    End If

    ‘— Suppress the popup screen
    If Idx = 1 Then
    ReturnCode = SendObj.ShowSendScreen(0)
    If ReturnCode = 1 Then
    Err.Raise enmElectronicDocErrors.eElectronicDocSendError
    ReturnCode = 0
    End If
    End If

    ‘— Wait Until EntryID is ready before moving on.
    If Idx = 1 Then

    StartTime = Timer
    Do While SendObj.IsEntryIDReady(0) <> 1
    DoEvents
    TestTime = Timer
    If TestTime >= (StartTime + 1200) Then
    Err.Raise enmElectronicDocErrors.eElectronicDocEntryIDReadyFailed
    End If
    Loop
    End If

    If mvLogging Then
    WriteToLogFile “WinFaxLog.TXT”, ” ===== Fax Sent to Fax Queue ====== ” & vbCrLf & vbCrLf
    End If
    ‘ destroy and recreate the send object so we can send another fax
    Set SendObj = Nothing
    Set SendObj = CreateObject(“WinFax.SDKSend”)
    SendObj.SetClientID (“Client Name”)

    Loop Until EOF(FileNum) = True

    Close #FileNum
    Next
    SendObj.Done
    Set SendObj = Nothing
    Set attachsObj = Nothing

    Exit Sub

    SendWinFaxesError:
    Close #FileNum
    mvErrorCode = SendObj.GetLastError()
    ‘ Set colTestFiles = Nothing
    Set SendObj = Nothing
    ErrorTrap “SendWinFaxes “
    Exit Sub
    Resume

    End Sub

    Anonymous
    Member

    Post your code, as it is likely something to do with timing or the order of the functions

    in reply to: Send dialog appears with SDK – dialog appears and nothing is #4658
    Anonymous
    Member

    I have implemented the IsReadyToPrint delay loop like the example code shows. However the customer says the problem of the send dialog popuping up for each send is still there. Is there any thing else that might correct this behavior?

    in reply to: temporary attachement – temporary attachement #4406
    Anonymous
    Member

    Temporary attachments are created when WinFax needs to convert a document to a fax image. An example would be when you attach a .TXT file. WinFax will convert the Txt file to a fax image and store the result in the “temporary attachments” area. When you send the SAME attachment again (the text file) instead of converting the document, it will just send the temporary attachment file is has already created.
    I believe temporary attachments are deleted automatically over time, and by deleting the temporary attachment it will not delete any of your faxes.

    in reply to: evaristo250 #6058
    Anonymous
    Member

    the only version of WinFax that is supported with Windows XP is version 10.02. Symantec also released WinFax Basic Edition 10.02 with Norton SystemWorks 2002.

    in reply to: Send Object and SetClientID – Purpose of SetClientID #4196
    Anonymous
    Member

    it can be anything, for example

    objWinFaxSend.SetClientID (“This is my client ID”)

    you can get away not using SetClientID for most functionality, but I recommend using it regardless.
    You need it if you are going to print and add attachments to WinFax.

    The documentation really doesn’t explain why it is required.

    Anonymous
    Member

    yes it does, but the events are fired off to either the host or the client WinFax (depending where your app is executed)

    For example, if you execute your app on the client WinFax, your faxes will be prepared on the client machine and then fax sharing would be used to actually send the fax.

    in reply to: SDK Log Object – Cannot Create Log Object #4221
    Anonymous
    Member

    Hi,

    it is possible that the attachment database got corrupted and caused other problems. There is a database rebuild app in SYMDIAG.EXE in the WinFax directory that may help in these cases.
    A reinstall usually helps too.

    in reply to: SDK Log Object – Cannot Create Log Object #4219
    Anonymous
    Member

    Which example are you running? Is it the one that comes with the SDK?

    in reply to: SDK and VBA – Attachment collection inside VBA #4477
    Anonymous
    Member

    Hi,
    you can use the MakeAttachment option to create an attachment, you can then add the attachment to the WinFax list of available attachments by using code :

    for example

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

    where .SetFilename is the attachment file you created with MakeAttachment.
    There is an example of this code here:

    http://www.getfaxing.com/cgi-bin/ikonboard/topic.cgi?forum=3&topic=8

    Anonymous
    Member

    IE will always show the dialog box, you need to use COM (print the document in code) rather than simply attaching the document, or use Netscape (or another HTML viewer) instead.

    Check out the Word example, your code would need to be something like this but instead of using Word, you are using IE.

    in reply to: Trouble Receiving #6727
    Anonymous
    Member

    Good to hear you resolved the problem!

Viewing 15 posts - 1,246 through 1,260 (of 1,288 total)