Function Reference

_OL_ViewSortFieldAdd

Adds/inserts SortFields for a view.

#Include <OutlookEX_GUI.au3>
_OL_ViewSortFieldAdd($oOL, $vView, $vFolder = Default, $aSortFields)

 

Parameters

$oOL Outlook object returned by a preceding call to _OL_Open()
$vView Index, name or object of the view to be modified
$vFolder Folder object as returned by _OL_FolderAccess or full name of folder. Has to be specified when $vView is not a view object
$aSortFields two dimensional zero-based array describing the SortFields to be added/inserted with the following columns:
0 - Name of the property (field name: displayed in the Field Chooser) to sort on
1 - One-based index number where to insert the property. If empty or 0 the property will be added after the last property
2 - IsDescending: If set to True, the property is sorted in descending order (default = False - the property is sorted in ascending order
$bReset [optional] Removes all existing SortFields from the View before adding the new SortFields (default = False)

 

Return Value

Success: Object of the view
Failure: Returns 0 and sets @error:
    1 - $vFolder has not been specified
    2 - Error accessing the specified folder. See @extended for errorcode returned by GetFolderFromID
    3 - Error accessing the folders views. @extended is set to the COM error code
    4 - View does not exist or an error occurred. @extended is set to the COM error code (if any)
    5 - Error adding/inserting a SortField. @extended is set to the zero-based index of the SortField in error
    6 - Error saving the new view. @extended is set to the COM error code
    7 - Invalid ViewType. Fields can only be added to the following ViewTypes: BusinessCardView, CalendarView, CardView, IconView, PeopleView, TableView

 

Remarks

None.

 

Related