+ Reply to Thread
Results 1 to 2 of 2

Best tutorial for building base/collection classes?

  1. #1
    Brian J. Matuschak
    Guest

    Best tutorial for building base/collection classes?

    Greetings:

    I have an Excel 2003 workbook with a sheet that was intended to schedule
    someone on the sheet (marked with green cells) through automation to Outlook
    2003. Now I find that I have to expand this to batch scheduling, and it
    would seem that I'd have to use a Collection object as it gathers from the
    sheet the event name, the employee name, start date, and end date, and that
    the reference would have to be called from this snippet in my code:
    ' Stuff up here works
    Next intColCounter
    ' Add a scheduled employee to the collection with event name, employee name,
    start date, and end date that are stored in variables created above
    Next intRowCounter
    ' Iterate through the collection and send Outlook appointments to shared
    calendars (I know how to do this).

    So, I've done a lot of searching through books and the Web, but nothing
    seems to stick. Does anyone out there know of a basic primer or tutorial out
    there that doesn't refer to VB 6 forms or is written in a continuous manner?
    The "Microsoft Visual Basic 6.0 Programmer's Guide" is a bit disjointed.

    Your help is most appreciated,
    --
    Brian J. Matuschak
    [email protected]

  2. #2
    Valued Forum Contributor tony h's Avatar
    Join Date
    03-14-2005
    Location
    England: London and Lincolnshire
    Posts
    1,187
    Te way you describe what you are trying to do leaves me a little confused. In this circumstance I would normally do the following.

    1. Create a class object to store the data about one person. Use Insert ClassModule and name it eg clsMyPerson .
    In the class module you need to create properties for each piece of data (name, start date, etc) Use Insert ... Procedure ... Property

    and variables in the Class Module to store the data

    eg code in class module

    Option Explicit

    Dim sName As String

    Public Property Get Name() As String
    Name = sName
    End Property

    Public Property Let Name(ByVal sNewName As String)
    sName = sNewName
    End Property


    Then in your loop (having declared a Dim ClsPerson as clsMyPerson)

    set clsperson = new clsmyperson

    populate the values

    clsperson.name= namestringvalue

    Then once populated just add it to a collection object. Although I would normally keep the collection object in a class object of it's own. As it makes it more manageable.

    regards

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1