Function Reference

_OL_NavigationFolderAdd

Adds navigation folders to a navigation group

#Include <OutlookEX_GUI.au3>
_OL_NavigationFolderAdd($oOL, $aFolders[, $iStartIndex = 0[, $iModuleType = Default]])

 

Parameters

$oOL Outlook object returned by a preceding call to _OL_Open()
$aFolders Array holding the folders to be added to the navigation group. Please see Remarks for further information
$iStartIndex [optional] Index of the first item of $aFolders to be processed. Should be 0 or 1 (default = 0)
$iModuleType [optional] Type of the navigation module. Can be any of the OlNavigationModuleType enumeration (default = $olModuleMail)

 

Return Value

Success: Number of processed navigation folders
Failure: Returns 0 and sets @error:
    1 - $oOL is not an object
    2 - Error accessing the navigation pane. @extended is set to the COM error code
    3 - Error accessing the navigation module. @extended is set to the COM error code
    4nnn - Error accessing the navigation groups. @extended is set to the COM error code. nnn is the index of the row in error
    5nnn - The specified navigation group could not be found. @extended is set to the COM error code. nnn is the index of the row in error
    6nnn - Error accessing the specified folder. @extended is set to @error as returned by _OL_FolderAccess. nnn is the index of the row in error
    7nnn - Error adding the nagivation folder. @extended is set to the COM error code. nnn is the index of the row in error
    8nnn - Error setting the position of the navigation folder. Must be a number and should be <= actual number of navigation folders + 1. nnn is the index of the row in error

 

Remarks

This function only works for Outlook 2007 and later.
The array has to have the same format as the result returned by _OL_NavigationFolderGet
(one based two-dimensional array holding Navigation group, Folder name, Folder path, IsSelected?, IsRemovable?, IsSideBySide?, Position).
The folderpath needs to be in the format as expected by _OL_FolderAccess.

 

Related

_OL_NavigationFolderRemove, _OL_NavigationFolderGet

 

See Also

https://docs.microsoft.com/en-us/office/vba/outlook/how-to/navigation/add-a-folder-to-the-favorite-folders-group; https://www.autoitscript.com/forum/topic/158418-outlookex-udf-help-support-iii/?do=findComment&comment=1344333