# -*- coding: iso-8859-1 -*- #. // OL_Folders8.py. #. // Lister les dossiers Outlook sur 8 niveaux. from _by_ferase import by_ferase # // Détruire un fichier. from _by_space import by_space # // Répéter un nombre de fois des espaces. from _by_ShellExecute import by_ShellExecute # // Effectue une opération sur un fichier spécifié. from _by_writeLine import by_writeLine # // Ecriture d'une ligne dans un fichier texte. from _ol_OutlookNew import ol_OutlookNew # // Ouvre Outlook. cFileOut = "_Result.txt" def OL_Folders8(): oOutlook = ol_OutlookNew() if oOutlook is None: return -1 #. endif by_ferase( cFileOut ) oFile = open( cFileOut, "w" ) oMapi = oOutlook.GetNamespace( "MAPI" ) Folders1 = oMapi.Folders for i in range( 1, Folders1.Count + 1, 1 ): Folder1 = Folders1.item( i ) print( "[ 1 ] " + Folder1.Name ) by_writeLine( oFile, "[ 1 ] " + Folder1.Name ) Folders2 = oMapi.Folders( Folder1.Name ) for j in range( 1, Folders2.Folders.Count + 1, 1 ): Folder2 = Folders2.Folders.item( j ) print( by_space( 6 ) + "[ 2 ] " + Folder2.Name ) by_writeLine( oFile, by_space( 6 ) + "[ 2 ] " + Folder2.Name ) Folders3 = Folder1.Folders( Folder2.Name ) for k in range( 1, Folders3.Folders.Count + 1, 1 ): Folder3 = Folders3.Folders.item( k ) print( by_space( 12 ) + "[ 3 ] " + Folder3.Name ) by_writeLine( oFile, by_space( 12 ) + "[ 3 ] " + Folder3.Name ) Folders4 = Folder2.Folders( Folder3.Name ) for l in range( 1, Folders4.Folders.Count + 1, 1 ): Folder4 = Folders4.Folders.item( l ) print( by_space( 18 ) + "[ 4 ] " + Folder4.Name ) by_writeLine( oFile, by_space( 18 ) + "[ 4 ] " + Folder4.Name ) Folders5 = Folder3.Folders( Folder4.Name ) for m in range( 1, Folders5.Folders.Count + 1, 1 ): Folder5 = Folders5.Folders.item( m ) print( by_space( 24 ) + "[ 5 ] " + Folder5.Name ) by_writeLine( oFile, by_space( 24 ) + "[ 5 ] " + Folder5.Name ) Folders6 = Folder4.Folders( Folder5.Name ) for n in range( 1, Folders6.Folders.Count + 1, 1 ): Folder6 = Folders6.Folders.item( n ) print( by_space( 30 ) + "[ 6 ] " + Folder6.Name ) by_writeLine( oFile, by_space( 30 ) + "[ 6 ] " + Folder6.Name ) Folders7 = Folder5.Folders( Folder6.Name ) for o in range( 1, Folders7.Folders.Count + 1, 1 ): Folder7 = Folders7.Folders.item( o ) print( by_space( 36 ) + "[ 7 ] " + Folder7.Name ) by_writeLine( oFile, by_space( 36 ) + "[ 7 ] " + Folder7.Name ) Folders8 = Folder6.Folders( Folder7.Name ) for p in range( 1, Folders8.Folders.Count + 1, 1 ): Folder8 = Folders8.Folders.item( p ) print( by_space( 42 ) + "[ 8 ] " + Folder8.Name ) by_writeLine( oFile, by_space( 42 ) + "[ 8 ] " + Folder8.Name ) #. endfor p #. endfor o #. endfor n #. endfor m #. endfor l #. endfor k #. endfor j #. endfor i oOutlook.Quit() oOutlook = None oFile.close() by_ShellExecute( cFileOut ) return 0 OL_Folders8() ''' Dernière modification : 2022-03-04 '''