Warning: This file has been marked up for HTML

VERSION 4.00
Begin VB.Form Form1 
   Caption         =   "Form1"
   ClientHeight    =   6075
   ClientLeft      =   1170
   ClientTop       =   1725
   ClientWidth     =   9375
   Height          =   6435
   Left            =   1110
   LinkTopic       =   "Form1"
   ScaleHeight     =   6075
   ScaleWidth      =   9375
   Top             =   1425
   Width           =   9495
   Begin VB.ComboBox Combo1 
      Height          =   315
      ItemData        =   "gwncc.frx":0000
      Left            =   120
      List            =   "gwncc.frx":000A
      Style           =   2  'Dropdown List
      TabIndex        =   8
      Top             =   3180
      Width           =   2595
   End
   Begin VB.CommandButton Command1 
      Caption         =   "Add to NCC Control"
      Height          =   375
      Left            =   120
      TabIndex        =   6
      Top             =   2280
      Width           =   2595
   End
   Begin VB.ListBox List1 
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "Courier New"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   4890
      Left            =   2880
      TabIndex        =   13
      Top             =   1080
      Width           =   6375
   End
   Begin VB.TextBox txtEMailType 
      Height          =   315
      Left            =   120
      TabIndex        =   5
      Top             =   1800
      Width           =   2595
   End
   Begin VB.TextBox txtDisplayName 
      Height          =   315
      Left            =   120
      TabIndex        =   1
      Top             =   360
      Width           =   2595
   End
   Begin VB.TextBox txtEMailAddress 
      Height          =   315
      Left            =   120
      TabIndex        =   3
      Top             =   1080
      Width           =   2595
   End
   Begin GWABLibCtl.GWab GWab1 
      Height          =   675
      Left            =   120
      TabIndex        =   9
      Top             =   3600
      Width           =   2595
      _Version        =   65536
      _ExtentX        =   4577
      _ExtentY        =   1191
      _StockProps     =   111
      Caption         =   "Address Book"
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      DisplayType     =   2
      CaptionPosition =   7
      BitmapPosition  =   1
      ShowButtons     =   2
      AddressBookName =   ""
   End
   Begin VB.Label Label1 
      Caption         =   "Return Address"
      Height          =   195
      Index           =   5
      Left            =   120
      TabIndex        =   7
      Top             =   2940
      Width           =   2595
   End
   Begin VB.Label Label1 
      Caption         =   "Results"
      Height          =   195
      Index           =   4
      Left            =   2880
      TabIndex        =   12
      Top             =   840
      Width           =   6375
   End
   Begin VB.Label Label1 
      Caption         =   "Name Completion Control"
      Height          =   195
      Index           =   3
      Left            =   2880
      TabIndex        =   10
      Top             =   120
      Width           =   6375
   End
   Begin VB.Label Label1 
      Caption         =   "EMail Type"
      Height          =   195
      Index           =   1
      Left            =   120
      TabIndex        =   4
      Top             =   1560
      Width           =   2595
   End
   Begin VB.Label Label1 
      Caption         =   "Display Name"
      Height          =   195
      Index           =   2
      Left            =   120
      TabIndex        =   0
      Top             =   120
      Width           =   2595
   End
   Begin VB.Label Label1 
      Caption         =   "EMail Address"
      Height          =   195
      Index           =   0
      Left            =   120
      TabIndex        =   2
      Top             =   840
      Width           =   2595
   End
   Begin GWNCCLib.GWncc GWncc1 
      Height          =   315
      Left            =   2880
      TabIndex        =   11
      Top             =   360
      Width           =   6375
      _Version        =   65536
      _ExtentX        =   11245
      _ExtentY        =   556
      _StockProps     =   69
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ShowAddressBookButton=   -1  'True
      ShowAddressList =   1
   End
End
Attribute VB_Name = "Form1"
Attribute VB_Creatable = False
Attribute VB_Exposed = False
'/***************************************************************************
'$name: gwncc.frm
'$version: 1.0 
'$date_modified: 121298 
'$description: This app demonstrates the GroupWise name completion control
'               and AddressBook control.
'$owner: GroupWise SDK Team Lead
'Copyright (c) 1998 Novell, Inc. All Rights Reserved.
'
'THIS WORK IS SUBJECT TO U.S. AND INTERNATIONAL COPYRIGHT LAWS AND TREATIES.
'USE AND REDISTRIBUTION OF THIS WORK IS SUBJECT TO THE LICENSE AGREEMENT
'ACCOMPANYING THE SOFTWARE DEVELOPMENT KIT (SDK) THAT CONTAINS THIS WORK.
'PURSUANT TO THE SDK LICENSE AGREEMENT, NOVELL HEREBY GRANTS TO DEVELOPER A
'ROYALTY-FREE, NON-EXCLUSIVE LICENSE TO INCLUDE NOVELL'S SAMPLE CODE IN ITS
'PRODUCT. NOVELL GRANTS DEVELOPER WORLDWIDE DISTRIBUTION RIGHTS TO MARKET,
'DISTRIBUTE, OR SELL NOVELL'S SAMPLE CODE AS A COMPONENT OF DEVELOPER'S
'PRODUCTS. NOVELL SHALL HAVE NO OBLIGATIONS TO DEVELOPER OR DEVELOPER'S
'CUSTOMERS WITH RESPECT TO THIS CODE.
'****************************************************************************/

Option Explicit

Private Sub Combo1_Change()

    GWab1.ReturnAddress = Combo1.ListIndex
    
End Sub

Private Sub Command1_Click()

Dim ret As Boolean
Dim iCounter As Integer

    ' Add information in the TextBoxes to the Name Completion control
    ret = GWncc1.Add(txtDisplayName, txtEMailAddress, txtEMailType)
    
    ' Display information from the Name Completion control in the ListBox
    List1.Clear
    For iCounter = 0 To GWncc1.Count - 1
        List1.AddItem "***********************"
        List1.AddItem "DisplayName          = " & GWncc1.DisplayName(iCounter)
        List1.AddItem "EmailAddress         = " & GWncc1.EMailAddress(iCounter)
        List1.AddItem "EmailType            = " & GWncc1.EMailType(iCounter)
    Next
    
End Sub

Private Sub Form_Load()
    
    ' Center the form
    Me.Move (Screen.Width - Me.Width) \ 2, (Screen.Height - Me.Height) \ 2
    
    ' Set the "Return Address" from the AddressBook control
    Combo1.ListIndex = GWab1.ReturnAddress
    
End Sub

Private Sub GWab1_OkClick()

Dim lCount As Long
Dim lMax As Long

    ' Display the selected items from the AddressBook control
    List1.Clear
    lMax = GWab1.Count - 1
    For lCount = 0 To lMax
        List1.AddItem "***********************"
        List1.AddItem "Address              = " & GWab1.Address(lCount)
        List1.AddItem "AddressType          = " & GWab1.AddressType(lCount)
        List1.AddItem "CellularPhoneNumber  = " & GWab1.CellularPhoneNumber(lCount)
        List1.AddItem "City                 = " & GWab1.City(lCount)
        List1.AddItem "Comment              = " & GWab1.Comment(lCount)
        List1.AddItem "CompanyName          = " & GWab1.CompanyName(lCount)
        List1.AddItem "Country              = " & GWab1.Country(lCount)
        List1.AddItem "Department           = " & GWab1.Department(lCount)
        List1.AddItem "DisplayName          = " & GWab1.DisplayName(lCount)
        List1.AddItem "EMailAddress         = " & GWab1.EMailAddress(lCount)
        List1.AddItem "EMailType            = " & GWab1.EMailType(lCount)
        List1.AddItem "FaxNumber            = " & GWab1.FaxNumber(lCount)
        List1.AddItem "Greeting             = " & GWab1.Greeting(lCount)
        List1.AddItem "HomePhoneNumber      = " & GWab1.HomePhoneNumber(lCount)
        List1.AddItem "MailStop             = " & GWab1.MailStop(lCount)
        List1.AddItem "OfficePhoneNumber    = " & GWab1.OfficePhoneNumber(lCount)
        List1.AddItem "State                = " & GWab1.State(lCount)
        List1.AddItem "Title                = " & GWab1.Title(lCount)
        List1.AddItem "ZipCode              = " & GWab1.ZipCode(lCount)
    Next
    
End Sub