Class Row (Outlook VBA)

The class Row represents a row of data in the Table object. To use a Row class variable it first needs to be instantiated, for example


Dim rw as Row
Set rw = AdvancedSearch.GetTable.FindNextRow()

BinaryToString

Obtains a String representing a value that has been converted from a binary value for the parent Row at the column specified by Index.

Use the helper functions Row.BinaryToString, Row.LocalTimeToUTC, and Row.UTCToLocalTime to facilitate type conversion of column values at a specific row. For more information on property value representation in a Table, see Factors Affecting Property Value Representation in the Table and View Classes.

BinaryToString (Index)

Index: A 1-based index value that can be either a Long representing the column index for the Columns collection or a String representing the Name of the Column.


Dim lngIndex As Long: lngIndex = 
Dim strBinaryToString As String
strBinaryToString = AdvancedSearch.GetTable.FindNextRow.BinaryToString(Index:=lngIndex)

Class

Returns a constant in the OlObjectClass enumeration indicating the class of the Row object. Here you can find possible values for OlObjectClass.


Dim oocsClass As OlObjectClass
oocsClass = AdvancedSearch.GetTable.FindNextRow.Class

GetValues

Obtains a one-dimensional array containing the values for all columns at the Row in the parent Table.

GetValues is a helper method that facilitates fetching all the column values in the Row in a single call. Since the array is zero-based, the length of the array is the number of columns in the Row minus one. Values returned in the array are of the same type as the values in the parent Table. This means that binary properties in the Table are returned as arrays of bytes. For date-time properties, if a Column is a default column or if it has been added using an explicit built-in property name, then its value in the Table and in the array are expressed in local time. If the Column has been added to the Table using a namespace reference, then its value in the Table and in the array are expressed in Coordinated Universal Time (UTC). For more information on referencing properties by namespace, see Referencing Properties by Namespace.


Dim arrGetValues() As Variant
arrGetValues() = AdvancedSearch.GetTable.FindNextRow.GetValues()

Item

Obtains an row that represents the value for the Row row at the column specified by Index.

The Item method is the default method of the Row object, meaning that the method can be used implicitly. The following two lines of code both access the value of the Subject property at the specified Row in a Table : Row.Item("Subject") Row("Subject") If a Column has been added to a Table using a property name referencing a namespace, you must reference the Column in the Row.Item method by the same namespace reference. If you use an explicit built-in name reference in Row.Item, you will get an error.

Item (Index)

Index: A 1-based index value that can be either a Long representing the column index for the Columns collection or a String representing the Name of the Column.


Sub DemoTable() 
 'Declarations 
 Dim Filter As String 
 Dim oRow As Outlook.Row 
 Dim oTable As Outlook.Table 
 Dim oFolder As Outlook.Folder 
 
 'Get a Folder object for the Inbox 
 Set oFolder = Application.Session.GetDefaultFolder(olFolderInbox) 
 
 'Define Filter to obtain items last modified after May 1, 2005 
 Filter = "[LastModificationTime] > '5/1/2005'" 
 'Restrict with Filter 
 Set oTable = oFolder.GetTable(Filter) 
 
 'Enumerate the table using test for EndOfTable 
 Do Until (oTable.EndOfTable) 
 Set oRow = oTable.GetNextRow() 
 Debug.Print (oRow("Subject")) 
 Debug.Print (oRow("LastModificationTime")) 
 Loop 
End Sub

LocalTimeToUTC

Obtains a Date value in a Table specified by the Row object at Index , that has been converted from local time to Coordinated Universal Time (UTC).

Use the helper functions Row.BinaryToString, Row.LocalTimeToUTC, and Row.UTCToLocalTime to facilitate type conversion of column values at a specific row. For information on property value representation in a Table, see Factors Affecting Property Value Representation in the Table and View Classes. For information on using Date-time comparisons in Table filters, see Filtering Items Using a Date-time Comparison.

LocalTimeToUTC (Index)

Index: A 1-based index value that can be either a Long representing the column index for the Columns collection or a String representing the Name of the Column.


Dim lngIndex As Long: lngIndex = 
Dim dtLocalTimeToUTC As Date
dtLocalTimeToUTC = AdvancedSearch.GetTable.FindNextRow.LocalTimeToUTC(Index:=lngIndex)

Session

Returns the NameSpace object for the current session.

The Session property and the Application.GetNamespace method can be used interchangeably to obtain the NameSpace object for the current session. Both members serve the same purpose. For example, the following statements perform the same function:

UTCToLocalTime

Obtains a Date value in a Table specified by the Row object at Index , that has been converted from Coordinated Universal Time (UTC) to local time.

Use the helper functions Row.BinaryToString, Row.LocalTimeToUTC, and Row.UTCToLocalTime to facilitate type conversion of column values at a specific row. For information on property value representation in a Table, see Factors Affecting Property Value Representation in the Table and View Classes. For information on using Date-time comparisons in Table filters, see Filtering Items Using a Date-time Comparison.

UTCToLocalTime (Index)

Index: A 1-based index value that can be either a Long representing the column index for the Columns collection or a String representing the Name of the Column.


Dim lngIndex As Long: lngIndex = 
Dim dtUTCToLocalTime As Date
dtUTCToLocalTime = AdvancedSearch.GetTable.FindNextRow.UTCToLocalTime(Index:=lngIndex)