home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Programmer'…arterly (Limited Edition) / Visual_Basic_Programmers_Journal_VB-CD_Quarterly_Limited_Edition_1995.iso / code / ch10code / addresso.cls < prev    next >
Text File  |  1994-10-10  |  2KB  |  71 lines

  1. Version 1.0 Class
  2. Attribute VB_Name = "AddressObject"
  3. Attribute VB_Creatable = True
  4. Attribute VB_Exposed = True
  5. Attribute VB_Description = "Address Book OLE Object"
  6. Const NAME_FLD = 1
  7. Const STREET_FLD = 2
  8. Const STREET2_FLD = 3
  9. Const CITY_FLD = 4
  10. Const STATE_FLD = 5
  11. Const ZIP_FLD = 6
  12. Const PHONE_FLD = 7
  13. Const WORK_FLD = 8
  14. Const FAX_FLD = 9
  15. Const NOTES_FLD = 10
  16. Const FIRST_FLD = NAME_FLD
  17. Const LAST_FLD = NOTES_FLD
  18.  
  19. Private Sub Class_Initialize()
  20.    Address.Visible = False
  21.    Load Address
  22.    Address.Command1_Click
  23. End Sub
  24.  
  25. Private Sub Class_Terminate()
  26.     If Address.Visible = False Then
  27.         Unload Address
  28.     End If
  29. End Sub
  30.  
  31.  
  32. Public Sub FindTelephoneNumbers()
  33.     Address.FindFirst_Click
  34. End Sub
  35.  
  36. Public Static Property Get Name() As String
  37.     FirstName = Address.AddressCtl(NAME_FLD)
  38. End Property
  39.  
  40. Public Static Property Let Name(Value As String)
  41.     Address.Command1_Click
  42.     Adress.AddressCtl(NAME_FLD) = Value
  43. End Property
  44.  
  45. Public Static Property Get Phone() As String
  46.     Phone = Address.AddressCtl(PHONE_FLD)
  47. End Property
  48.  
  49. Public Static Property Let Phone(Value As String)
  50.     Address.Command1_Click
  51.     Adress.AddressCtl(PHONE_FLD) = Value
  52. End Property
  53.  
  54. Public Static Property Get Workphone() As String
  55.     Workphone = Address.AddressCtl(WORK_FLD)
  56. End Property
  57.  
  58. Public Static Property Let Workphone(Value As String)
  59.     Address.Command1_Click
  60.     Adress.AddressCtl(WORK_FLD) = Value
  61. End Property
  62.  
  63. Public Static Property Get Fax() As String
  64.     Fax = Address.AddressCtl(FAX_FLD)
  65. End Property
  66.  
  67. Public Static Property Let Fax(Value As String)
  68.     Address.Command1_Click
  69.     Adress.AddressCtl(FAX_FLD) = Value
  70. End Property
  71.