#6735
Support 1
Participant

    Here is some sample code to:

    • Determine whether the [Shift] key is down.
    • Retrieve Address Book entry attributes.
    Sub Main(Client, GWEvent)
     
     dim oField
     dim oEntry
     dim oFieldObj
     dim oAddressBook
     
    
     ' Determines whether a key is up or down at the time the function is called.
     if Utilities.KeyIsDown(VK_SHIFT) then
        Msgbox("Shift Key Pressed")
     end if
     
    
     set oAddressBook = GroupWise.Account.AddressBooks.Item("Novell GroupWise Address Book")
     
     if oAddressBook is nothing then
       exit sub
     end if
     
    
     ' We are getting an entry using the index value
     set oEntry = oAddressBook.AddressBookEntries.Item(1)
     if oEntry is nothing then
       exit sub
     end if
     
     msgbox "Name: " & oEntry.DisplayName
     msgbox "Email Address: " & oEntry.EmailAddress
     
     ' You can access all the properties using the fields collection. The sample code
     ' accesses the first item in the collection. See GroupWise Object API documentation for
     ' more details.
     ' http://developer.novell.com/ndk/doc/gwobjapi/index.html?gwobjenu/data/h7ikbsqg.html
     set oFieldObj = oEntry.Fields
     
     set oField = oFieldObj.Item(1)
     if not oField is nothing then
       msgbox (oField.value)
     end if
     
    
     set oEntry = nothing
     set oFieldObj = nothing
     set oField = nothing
     set oAddressBook = nothing
     
    End Sub
    

    Advansys Support