Patterns Collection and Pattern Object

[Previous] [Next]

The Views collection contains one or more views for a ContainerRenderer object. The Views collections allows you to access existing views on your folders or to create new, dynamic views for your web applications. The following section describes the methods and properties for the View collection.

Views Collection Method

The only method for the Views collection is the Add method. This method creates and returns a new TableView or CalendarView object. The Add method takes one required parameter and three optional parameters:

  • The required parameter is a string that is the display name for the view.
  • The first optional parameter is the class of the view to create. The only supported classes are CdoClassCalendarView (12) and CdoClassTableView (9). The default class is CdoClassTableView.
  • The second optional parameter is the property with which to sort the new view. If a corresponding column is present in the view, the default property for this parameter is CdoPR_MESSAGE_DELIVERY_TIME.
  • The final optional parameter is a Boolean that specifies the sort direction for the new view. If you set this property to True, the view will be sorted in ascending order. Setting the property to False, which is the default, sorts the view in descending order.

The following code shows an example of the Add method being used:

     Set oView = oCRenderer.Views.Add( "New View", 1)         Set oColumns = oView.Columns         oColumns.Add "Subject", CDOPR_SUBJECT, 20, 0, 99         oColumns.Add "Delivery Time", _             CDOPR_MESSAGE_DELIVERY_TIME, 10, 0, 99         oColumns.Add "Submit Time", CDOPR_CLIENT_SUBMIT_TIME, 10, 0, 99         oColumns.Add "Sender Name", CDOPR_SENDER_NAME, 15, 0, 99         oColumns.Add "<IMG SRC=urgent.gif>", CDOPR_IMPORTANCE,  1, 0, 99     oColumns.Add "READ RECEIPT!", _         CDOPR_READ_RECEIPT_REQUESTED, 10, 0, 0

Views Collection Properties

Two properties of the Views collection are Count and Item. The Count property returns the number of View objects in the collection. The Item property returns a specific CalendarView or TableView object from the collection. You can specify either an index or a name to the Item property.



Programming Microsoft Outlook and Microsoft Exchange
Programming Microsoft Outlook and Microsoft Exchange, Second Edition (DV-MPS Programming)
ISBN: 0735610193
EAN: 2147483647
Year: 2000
Pages: 184

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net