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

    Aug 29, 2007
    Likes Received:
    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
    End Sub
  2. demonofsteel

    demonofsteel New Member

    Mar 28, 2008
    Likes Received:
    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.