RightFax and why doesnt my code work??

Posted on 2004-11-16
Last Modified: 2008-02-26
I'm experimenting/testing the API Com of some fax software we use at work called RightFax by the API tuition supplied by them doesnt seem to work (or i'm doing something very wrong.

The form consists of 2 listboxes, and 1 command button.

the form loads ok and the first listbox1 populates with the users.

I then slelect the required user from the list but when I press the command button I get  runtime error 424 object required.

heres the code......


Public gl_MyFaxServer As RFCOMAPILib.FaxServer
Public gl_SelectedUser As String
Dim obj_Fax As RFCOMAPILib.Fax
Dim str_File As String, str_FromName As String
Dim str_UserName As String
Dim str_UserID As String


Private Sub btn_ListFaxes_Click()

For Each obj_Fax In MyFaxServer.Faxes(gl_SelectedUser)
str_faxfilename = obj_Fax.FaxFilename
str_FromName = obj_Fax.FromName
lst_FaxList.AddItem str_faxfilename + vbTab + str_FromName

End Sub
Private Sub Form_Load()

Set gl_MyFaxServer = New RFCOMAPILib.FaxServer

gl_MyFaxServer.ServerName = "sever1"
gl_MyFaxServer.UseNTAuthentication = False
gl_MyFaxServer.AuthorizationUserID = "aname"
gl_MyFaxServer.AuthorizationUserPassword = ""
gl_MyFaxServer.Protocol = cpNamedPipes

For Each User In gl_MyFaxServer.Users
str_UserID = User.ID
str_UserName = User.UserName
lst_Users.AddItem str_UserID + vbTab + str_UserName

End Sub

Private Sub lst_Users_Click()

Dim objUser As RFCOMAPILib.User
Set objUser = gl_MyFaxServer.Users(lst_Users.ListIndex + 1)
gl_SelectedUser = objUser.ID
End Sub
Question by:octoped
    LVL 26

    Expert Comment

    should it be



    Author Comment

    Saddly that didnt work either, same error :(
    LVL 26

    Accepted Solution

    should it be

    For Each obj_Fax In gl_MyFaxServer.Faxes(gl_SelectedUser)

    instead of

    For Each obj_Fax In MyFaxServer.Faxes(gl_SelectedUser)

    wher do you defined MyFaxServer

    Author Comment

    I'm not at work now until thursday so I cant test it now. But if it helps this is the Rightfax tutorial i'm trying to follow. its the first one in the guide. This should give you an idea of what its suposed to do.

    Author Comment

    Thanks, you were spot on, can't believe I overlooked that one.
    LVL 26

    Expert Comment

    By the way

    it is good to put

    Option Explicit

    at the beginning on each module and form

    Featured Post

    What Is Threat Intelligence?

    Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

    Join & Write a Comment

    Suggested Solutions

    Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
    There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
    As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
    Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now