Forum Replies Created
-
AuthorPosts
-
November 16, 2001 at 6:54 pm in reply to: ReleaseDispatch Timing – How to wait long enough for component unloading #4478AnonymousMember
you can use the IsEntryIDReady to determine if WinFax returns an entry id. then you can terminate the Sendobject.
AnonymousMemberthe 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.
AnonymousMemberIgnore this one too
(Edited by alexmcmorris at 3:42 pm on Nov. 5, 2001)
November 5, 2001 at 2:06 pm in reply to: Send dialog appears with SDK – dialog appears and nothing is #4660AnonymousMemberThis 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 StringOn Error GoTo SendWinFaxesError
If FileLen(mvFaxControlFile) = 0 Then
Err.Raise enmElectronicDocErrors.eElectronicDocNoFaxControlFile
End IfIf 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 IfIf attachsObj Is Nothing Then
Err.Raise enmElectronicDocErrors.eElectronicDocWinProComponentNotFound
End IfCleanupFaxTempFiles
‘— 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 IfFileNum = FreeFile()
If FileNum = 1 Then FileNum = 8‘Open the control file
Open mvFaxControlFile For Input As FileNumIf mvLogging Then
If Idx = 0 Then
WriteToLogFile “WinFaxLog.TXT”, ” *** Starting WinFax Test Run *** “
Else
WriteToLogFile “WinFaxLog.TXT”, ” *** Starting WinFax Transmitting Run *** “
End If
End IfDo
‘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, _
mvDocPathIf 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 = TrueIf mvUsingDocExtension Then
DocPath = mvDocPath
mvDocPath = “”
mvDocPath = CreateUniqueTempWinFaxFile(DocPath)
End IfIf 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 IfIf 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$(mvFaxNumber, 3)
End IfIf 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$(mvFaxNumber, 7)
If Len(PhoneNumber) = 0 Then
Err.Raise enmElectronicDocErrors.eElectronicDocInvalidPhoneNumber
End IfReturnCode = SendObj.SetNumber(PhoneNumber)
If ReturnCode = 1 Then
Err.Raise enmElectronicDocErrors.eElectronicDocInvalidPhoneNumber
ReturnCode = 0
End IfIf 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 IfReturnCode = 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 ThenStartTime = Timer
Do While SendObj.IsEntryIDReady(0) <> 1
DoEvents
TestTime = Timer
If TestTime >= (StartTime + 1200) Then
Err.Raise enmElectronicDocErrors.eElectronicDocEntryIDReadyFailed
End If
Loop
End IfIf 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 = NothingExit Sub
SendWinFaxesError:
Close #FileNum
mvErrorCode = SendObj.GetLastError()
‘ Set colTestFiles = Nothing
Set SendObj = Nothing
ErrorTrap “SendWinFaxes “
Exit Sub
ResumeEnd Sub
November 3, 2001 at 4:10 am in reply to: Send dialog appears with SDK – dialog appears and nothing is #4659AnonymousMemberPost your code, as it is likely something to do with timing or the order of the functions
November 1, 2001 at 11:04 pm in reply to: Send dialog appears with SDK – dialog appears and nothing is #4658AnonymousMemberI 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?
AnonymousMemberTemporary 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.AnonymousMemberthe 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.
AnonymousMemberit 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.
October 24, 2001 at 3:20 am in reply to: SDK and Fax Sharing Mode – WinFax Pro 10 in Fax Sharing Mode #4229AnonymousMemberyes 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.
AnonymousMemberHi,
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.AnonymousMemberWhich example are you running? Is it the one that comes with the SDK?
AnonymousMemberHi,
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.AddAttachmentwhere .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
October 15, 2001 at 2:38 pm in reply to: SDKSend Problem With HTML Attachment File – IE Print Dialog Box appears #4555AnonymousMemberIE 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.
AnonymousMemberGood to hear you resolved the problem!
-
AuthorPosts