![]() 'prints the folder path and name in the VB Editor's Immediate windowĬall ColorizeOneFolder(strTempFolderPath, strFolderColour)įor Each olNewFolder In olProjectRootFolder.FoldersĬall ColorizeFolderAndSubFolders(olNewFolder.FolderPath, strFolderColour)Ĭall ColorizeFolderAndSubFolders("\\Personal\Documents\000-Mgmt-CH\100-People", "blue")Ĭall ColorizeFolderAndSubFolders("\\Personal\Documents\000-Mgmt-CH\200-Projects", "red")Ĭall ColorizeFolderAndSubFolders("\\Personal\Documents\000-Mgmt-CH\500-Meeting", "green")Ĭall ColorizeFolderAndSubFolders("\\Personal\Documents\000-Mgmt-CH\800-Product", "magenta")Ĭall ColorizeFolderAndSubFolders("\\Personal\Documents\000-Mgmt-CH\600-Departments", "grey")Ĭall ColorizeFolderAndSubFolders("\\Mailbox - Dan Wilson\Inbox\Customers", "grey")Ĥ. StrTempFolderPath = olTempFolder.FolderPath Set olTempFolder = olProjectRootFolder.Folders(i) ' Loop through the items in the current folder.įor i = To 1 Step -1 Set olProjectRootFolder = GetFolder(strFolderPath)Ĭall ColorizeOneFolder(strFolderPath, strFolderColour) ' this procedure colorizes the foler given by strFolderPath and all subfolfersĭim olProjectRootFolder As Outlook.folder Sub ColorizeFolderAndSubFolders(strFolderPath As String, strFolderColour As String) 'Debug.Print "setting colour to " + FolderPath + " as " + FolderColour Set myPic = LoadPicture("C:\icons\" + FolderColour + ".ico") Sub ColorizeOneFolder(FolderPath As String, FolderColour As String) Set TempFolder = SubFolders.Item(FoldersArray(i)) 'Remove Leading slashes in the folder pathįolderPath = Right(FolderPath, Len(FolderPath) - 2) ' Returns an Outlook folder object basing on the folder path ![]() Text Function GetFolder(ByVal FolderPath As String) As Outlook.folder
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |