Kroll-Software Home | Diese Seite auf deutsch


KSWabControl OCX Documentation

Library: KSWABLib (KSWab ActiveX Control module)
GUID: {290CA8F7-D7F5-11D3-8BE5-0000B4560A22}
Version: 1.0

Dependencies: none

 
General Information
License / Order
Download
Installation

Interface

Code Examples


General Information

Use this OCX component to read contacts from the Windows Addressbook (WAB) / MS Outlook Express. Implement a 'Import from Outlook Express' function in your database application.


License / Order

Disclaimer: KSWab-Control is provided "as is" with no warranty of any kind.

KSWab-Control is not FreeWare. The control is not crippled in any way. You can test it for 6 weeks. You must obtain a developer license after this trial period.

A developer licens allows you to use KSWabControl on a single developer machine. On this computer the file "kswab.lic" is to be installed. This license file must not be distributed.

After obtaining a license, you may distribute the KSWab-Control together with your application without paying any further royalties.

 
KSWab-Control Order
Kreditkarten: VISA, Mastercard, American Express, Diners Club

Secure payment with credit card, bank transfer or check
through ShareIt! element 5 AG, Cologne.

The cost for a single developer license is EUR 89,- net amount

 


Download

The current version can always be found under www.kroll-software.de/download/kswabcontrol.zip

Find out more about Kroll Software-Development under www.kroll-software.de/produkte/


Installation

  1. Copy kswab.ocx and kswab.lic to your harddisk
  2. Register the control by entering
    regsvr32.exe <Drive:Path\>kswab.ocx at the windows prompt

Never distribute the *.lic - file. It is only needed on your developer machine and not at runtime.


Enumerations

The following enumerations are defined in the typelib:

wabSeekOptions

Constant Value Remarks
Seek_From_Beginning 0 Seek from Beginning
Seek_From_Current 1 Seek from current position
Seek_From_End 2 Seek from end

wabGenders

Constant Value Remarks
wab_Gender_Unknown 0 unknown gender
wab_Gender_Female 1 female
wab_Gender_Male 2 male

wabDefaultAddress

Constant Value Remarks
wab_Default_Address_Unknown 0 Unknown Standard Address
wab_Default_Address_Private 1 Private is standard address
wab_Default_Address_Business 2 Business is standard address

wabFields

Some constant names are self-explaining.
See the tabs of the WAB standard dialog "Properties"

Constant Value WAB-Data Type Wab-Constant
wabf_Name_FirstName 1 PT_STRING8 PR_GIVEN_NAME
wabf_Name_SecondName 2 PT_STRING8 PR_MIDDLE_NAME
wabf_Name_LastName 3 PT_STRING8 PR_SURNAME
wabf_Name_Title 4 PT_STRING8 PR_DISPLAY_NAME_PREFIX
wabf_Name_DisplayName 5 PT_STRING8 PR_DISPLAY_NAME
wabf_Name_NickName 6 PT_STRING8 PR_NICKNAME
wabf_Name_EMail 7 PT_STRING8 PR_EMAIL_ADDRESS
wabf_Private_Street 8 PT_STRING8 PR_HOME_ADDRESS_STREET
wabf_Private_City 9 PT_STRING8 PR_HOME_ADDRESS_CITY
wabf_Private_State 10 PT_STRING8 PR_HOME_ADDRESS_STATE_OR_PROVINCE
wabf_Private_PostalCode 11 PT_STRING8 PR_HOME_ADDRESS_POSTAL_CODE
wabf_Private_Country 12 PT_STRING8 PR_HOME_ADDRESS_COUNTRY
wabf_Private_Phone 13 PT_STRING8 PR_HOME_TELEPHONE_NUMBER
wabf_Private_Fax 14 PT_STRING8 PR_HOME_FAX_NUMBER
wabf_Private_Mobile 15 PT_STRING8 PR_CELLULAR_TELEPHONE_NUMBER
wabf_Private_Homepage 16 PT_STRING8 PR_PERSONAL_HOMEPAGE
wabf_Business_Company 17 PT_STRING8 PR_COMPANY_NAME
wabf_Business_Street 18 PT_STRING8 PR_STREET_ADDRESS
wabf_Business_City 19 PT_STRING8 PR_LOCALITY
wabf_Business_State 20 PT_STRING8 PR_STATE_OR_PROVINCE
wabf_Business_PostalCode 21 PT_STRING8 PR_POSTAL_CODE
wabf_Business_Country 22 PT_STRING8 PR_COUNTRY
wabf_Business_Title 23 PT_STRING8 PR_TITLE
wabf_Business_Department 24 PT_STRING8 PR_DEPARTMENT_NAME
wabf_Business_Office 25 PT_STRING8 PR_OFFICE_LOCATION
wabf_Business_Phone 26 PT_STRING8 PR_BUSINESS_TELEPHONE_NUMBER
wabf_Business_Fax 27 PT_STRING8 PR_BUSINESS_FAX_NUMBER
wabf_Business_Pager 28 PT_STRING8 PR_PAGER_TELEPHONE_NUMBER
wabf_Business_IP_Phone 29 PT_STRING8 unknown 0x800a001e
wabf_Business_Homepage 30 PT_STRING8 PR_BUSINESS_HOMEPAGE
wabf_Personal_Gender 31 PT_I2 PR_GENDER
wabf_Personal_Birhday 32 PT_SYSTIME PR_BIRTHDAY
wabf_Object_Type 33 PT_LONG PR_OBJECT_TYPE
wabf_Record_Changed 34 PT_STRING8 unknown 0x30080040
wabf_Default_Address_Index 35 PT_STRING8 unknown 0x80110003
wabf_Address_Type 36 PT_STRING8 PR_ADDRTYPE
wabf_Contact_Email_Adresses 37 PT_MV_STRING8 PR_CONTACT_EMAIL_ADDRESSES
wabf_Contact_Address_Types 38 PT_MV_STRING8 PR_CONTACT_ADDRTYPES
wabf_Contact_Default_Address_Index 39 PT_LONG PR_CONTACT_DEFAULT_ADDRESS_INDEX
wabf_Send_Internet_Encoding 40 PT_LONG PR_SEND_INTERNET_ENCODING
wabf_Other_Comment 41 PT_STRING8 PR_COMMENT


Properties

Property Type In/Out Default Remarks
RecordCount long read only 0 Record Count
EOF Boolean read only True End Of File


Methods

AboutBox()

Return Value: void
Parameters: none
 
Shows the AboutBox.

 

OpenWab()

Return Value: Boolean
Parameters: Filename As String
 
Opens a Windows-Addressbook (*.wab).
If filename is empty, the standard address-book will be used. Returns True, if successful.
After that, RecordCount is valid.

 

CloseWab()

Return Value: void
Parameters: none
 
Closes the Addressbook.
Is called automatically when closing the instance of the control.

 

SeekRow()

Return Value: Boolean
Parameters: Row As Long, SeekOption As wabSeekOptions
 
Skips to the first/next/#number record

Examples:

OK = KSWab1.SeekRow(0, Seek_From_Beginning) Initialising after OpenWab()
OK = KSWab1.SeekRow(1, Seek_From_Currrent) loop through records, until EOF=True
OK = KSWab1.SeekRow(n, Seek_From_Beginning) n-th Record

 

GetField()

Return Value: VARIANT
Parameters: PropertyTag As wabFields
 
Reads a field-value from the current record

Examples:

S = KSWab1.GetField(wabf_Name_DisplayName) Get value for DisplayName
(data-type Variant/String)
V = KSWab1.GetField(wabf_Contact_Email_Adresses)

S = ""
If Not IsEmpty(V) Then
    For i = 0 To UBound(V)
        S = S & V(i) & ";"
    Next
End If

Gets a list of email-addresses
(data-type Variant/Array)

Then iterating through the list.

 

GetFieldEx()

Return Value: VARIANT
Parameters: PropType As long, PropID As long
 
Same as GetField().

Instead of a Field-Constant a PropType and a PropID is given. See MSDN for constant ID's. You will normally not need this function.

Examples:

S = KSWab1.GetFieldEx(&H1E, &H3A51)

is equivalent to

S = KSWab1.GetField(wabf_Business_Homepage)

 

ShowStandardDialog()

Return Value: void
Parameters: ParentHwnd As long
 
Shows the standard dialog "Properties" for the current record.
The record can be edited.

Example:

If KSWab1.SeekRow(Row, Seek_From_Beginning) Then
    KSWab1.ShowStandardDialog Me.hWnd
Else
    MsgBox "Invalid Row.", vbExclamation
End If

 

NewEntryDialog()

Return Value: void
Parameters: ParentHwnd As long
 
Shows the standard dialog for inserting a new record.

Example:

KSWab1.NewEntryDialog Me.hWnd

 

DeleteEntry()

Return Value: void
Parameters: none
 
Deletes the current record.

 


Code Example

VisualBasic

You can find a VisualBasic 6 Demo Project in this distribution.

The control was inserted into the project by "Project / Components".
The control was drag/dropped on the form from the toolbox.

Typical Steps:

  1. Call OpenWab ""
  2. Call method .SeekRow(0, Seek_From_Beginning)
  3. Check for property EOF
  4. Read Field-Values with GetFields()
  5. Call .SeekRow(1, Seek_From_Currrent)
  6. Loop from step (3) until EOF=True
  7. Close the addressbook with CloseWab()

 
--- End ---