Dismiss Notice
We would like to remind you that we’re updating our login process for all 3CX forums whereby you will be able to login with the same credentials you use for the Partner or Customer Portal. Click here to read more.

Call 3CX client from VBA application (access, excel ..)

Discussion in 'Windows' started by alphachrome, Apr 28, 2008.

Thread Status:
Not open for further replies.
  1. alphachrome

    Joined:
    Aug 29, 2007
    Messages:
    7
    Likes Received:
    0
    Just for information ....

    NB : Tools/References: TAPI3

    Private Sub PhoneDialTapi(sNumber As String)
    'Dim bFound As Boo :idea: :idea: lean
    Dim indexAddr As Integer
    Dim objCollAddresses As Object
    Dim objCrtAddress As ITAddress
    Dim objcollAddress As Object
    Dim gobjTapi As TAPI
    ' Create the tapi object.
    Set gobjTapi = New TAPI
    ' Call Initialize before calling any other TAPI function.
    Call gobjTapi.Initialize
    ' pick up the collection of Address objects
    Set objCollAddresses = gobjTapi.Addresses
    ' find address for 3CX VoIP Clien
    'bFound = False
    For indexAddr = 2 To objCollAddresses.Count
    Set objCrtAddress = objCollAddresses.Item(indexAddr)
    If objCrtAddress.AddressName = "3CX VoIP Client" Then
    If objCrtAddress.QueryMediaType(TAPIMEDIATYPE_AUDIO) Then 'just for test !!
    Set gobjAddress = objCollAddresses.Item(indexAddr)
    Set gobjCall = gobjAddress.CreateCall(RTrim(sNumber), LINEADDRESSTYPE_PHONENUMBER, TAPIMEDIATYPE_AUDIO)
    gobjCall.Connect (False)
    'bFound = True
    End If
    End If
    Next
    End Sub
     
  2. demonofsteel

    demonofsteel New Member

    Joined:
    Mar 28, 2008
    Messages:
    105
    Likes Received:
    0
    Wow! That's something very nice, I will most likely build an adress book using Access then since you provided this code. Is it fully working yet?

    Like I said, I was planning to build an adress book, this code will help for sure, so that the users will be able to place the call directly from the adress book.

    Thanks for your code.
     
Thread Status:
Not open for further replies.