Fax Software

Community Forums

  • This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #2573
    ER Slansky
    Member

    I need to add an Access 2k Report to the attachment database to be faxed later. The report may need to have 3 copies sent to one recipient and one copy sent to another recipient. I first create a SEND object to print the report using the MakeAttachment method. I then use the Attachment object and the AddAttachment method to add it to the attachments database. I then set the Attachment and SEND objects to nothing, and want to create a new SEND object to actually attach multiple copies (in a loop using the AddAttachment method of the SEND object) and send the fax.

    I have tried since the end of September and cannot find any combination of creating/destroying the Send object which will not crash WinFax after I execute the AddAttachment method of the ATTACHMENT object. I’ve uninstalled/reinstalled twice with no effect.

    If I examine the GetAttachmentCount and GetRecipientCount of the SEND object before I execute the Attachment.AddAttachment method, they are both 0…after the method is executed, I get really strange numbers like 26740 and 372, respectively. I’ve tried to code in VB6 the Word MakeAttachment example posted here with the same odd results for the counts. If I modify the example code to try and create a second SEND object at the very end, WinFax crashes.

    It doesn’t seem to matter if I Dim the objects with late or early binding. The report is created and added to the database successfully. I’ve also tried to set the SEND object to Nothing before executing the Attachment.AddAttachment method, but then Winfax crashes when it reaches that line. I’ve also used the Attachments.NewAttachment method to try and set the Attachment object, but that does not seem to make a difference either.

    Has anyone else had experience with successfully doing something similar? I hate to have to make three separate faxes of the same report faxing to the same recipient just to avoid the Attachment.AddAttachment method. I can post some sample code – maybe I’m doing a method call out of order.

    Thanks,

    ER Slansky

    #4333
    Anonymous
    Member

    I have not tried that combination before, does it work if you don’t destroy the send object after creating the attachments?

    #4334
    ER Slansky
    Member

    No – when I am ready to actually create and send the fax to the recipient, if I do not set the SEND object to nothing and attempt to recreate it, I get an Automation Error every time I try to execute the AddRecipient and the AddAttachment methods of the SEND object. I’m guessing that I am somehow not getting a good reference to the Attachment object, so when I execute the Attachment.Addattachment method, I am overwriting the recipient and attachment info portion of the SEND object.

    I really just need to figure out what methods of the SEND object I have to invoke in order to “print” a series of reports and simply add them to the Attachments database. There may be times that I will need to add 20-50 reports. At the end of the day, the faxes will be created to send the reports to the appropriate recipients (i.e. reports 1, 6, and 20 may go to recipient A, who gets 2 copies of every report; reports 2,3, and 30 may go to recipient B who gets one copy of every report, etc. – does this make sense what I want to accomplish?) Right now, I’m just trying to get it to work for ONE report to ONE recipient and I can’t even do that.

    I’m trying to do the printing and adding of the report this way:

    If objWFXSend Is Nothing Then
    Set objWFXSend = New CSDKSend
    objWFXSend.SetClientID ( “test_client” )
    objWFXSend.LeaveRunning
    End If

    Set objWFXAttachment = CreateObject( “WinFax.Attachment” )
    Set objWFXAttachments = CreateObject(“WinFax.Attachments”)

    objWFXSend.ShowSendScreen (0)

    ‘ Before I did this, the send dialog would appear.
    objWFXSend.SetPreviewFax (0)

    objWFXSend.SetPrintFromApp (1)

    ‘ I don’t know if I need to do this or not – it doesn’t work ‘ whether I do or not, I just get different errors.
    ‘ objWFXSend.Send (0)

    objWFXSend.MakeAttachment txtSpecID, “G:PathFaxData”, 0
    DoCmd.OpenReport strDocName, acViewNormal

    Set objWFXAttachment = objWFXAttachments.NewAttachment
    str_File_Name = “G:PathFaxData” & file_name & “.fxs”

    objWFXAttachment.SetMultipage (0)
    objWFXAttachment.SetDescription (str_Description)
    objWFXAttachment.SetFileName (str_File_Name)

    ‘ Here, these values are zero:
    int_Attachment_Count = objWFXSend.GetAttachmentCount
    int_Recipient_Count = objWFXSend.GetRecipientCount

    int_Return_Code = objWFXAttachment.AddAttachment

    ‘Now these values are really strange numbers, like 26000 and 372
    int_Attachment_Count = objWFXSend.GetAttachmentCount
    int_Recipient_Count = objWFXSend.GetRecipientCount

    This is just one of different variations I have tried. Sometimes I’ve tried just using the Attachment object without setting it to a NewAttachment, but nothing change.

    If there is anyone experienced with this or sees an obvious error, please respone. I really don’t know if I need to exececute the Send(0) before or after the .MakeAttachment method, or even at all. The .MakeAttachment and .Addattachment DO work – the reports DO end up in the WinFax attachment database.

    Thanks,

    ER Slansky

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