Sub CategoriesByStore() Dim colStores As Stores Dim oStore As store Dim objCategories As Categories Dim objCategory As Category Dim i As Long Set colStores = Session.Stores ' Debug.Print "colStores.count: " & colStores.count For i = 1 To colStores.count Set oStore = colStores(i) Debug.Print "Store " & i & ": " & oStore If oStore = "store name from immediate window" Then Set objCategories = oStore.Categories For Each objCategory In objCategories Debug.Print objCategory Next Exit For End If Next End Sub
Outlook-Kategorien zählen für Shared Mailbox
341
Craig
Ich versuche, die Anzahl der Elemente zu ermitteln, die einer Kategorie in einem freigegebenen Postfach zugeordnet sind, das mit meinem Outlook-Konto verknüpft ist. Der gesamte Code, den ich gefunden habe, bezieht sich nur auf die tatsächlichen Outlook-Kategorien. Ich bin nicht sicher, wie das Element so eingestellt wird, dass es das freigegebene Postfach anzeigt, damit die Kategorien gezählt werden. Ich glaube, das Problem ist der Code in Fettdruck unten, aber ich kann keine Eigenschaft finden, die auf die gemeinsam genutzte Mailbox verweist.
Ich habe diesen Code ein wenig an meine Bedürfnisse angepasst, aber er wurde von Shirley Zhang geschrieben:
Public objDictionary As Object Public objExcelApp As Excel.Application Public objExcelWorkbook As Excel.Workbook Public objExcelWorksheet As Excel.Worksheet Sub ExportCountofItemsinEachColorCategories() Dim objCategories As Object Dim objCategory As Object Dim objPSTFile As Outlook.Folder Dim objFolder As Outlook.Folder Dim strExcelFile As String 'Create a New Excel file Set objExcelApp = CreateObject("Excel.Application") Set objExcelWorkbook = objExcelApp.Workbooks.Add Set objExcelWorksheet = objExcelWorkbook.Sheets("Sheet1") objExcelWorksheet.Cells(1, 1) = "Color Category" objExcelWorksheet.Cells(1, 2) = "Count" 'Find all the color categories Set objDictionary = CreateObject("Scripting.Dictionary") 'I believe the error is here vvv Set objCategories = Outlook.Application.Session.Categories For Each objCategory In objCategories objDictionary.Add objCategory.Name, 0 Next Set objPSTFile = Outlook.Application.Session.PickFolder For Each objFolder In objPSTFile.Folders ProcessFolder objFolder Next 'Save the new Excel file objExcelWorksheet.Columns("A:B").AutoFit strExcelFile = "C:\Users\cdlane\Documents\Color Categories (" & Format(Now, "yyyy-mm-dd_hh-mm-ss") & ").xlsx" objExcelWorkbook.Close True, strExcelFile MsgBox "Complete!", vbExclamation End Sub
1 Antwort auf die Frage
0
niton
Verwandte Probleme
-
2
Konvertieren Sie Excel 4.0-Makro in VBA
-
3
Fixieren Sie ein (Heute) Datum in Excel
-
4
Excel 2007 | Entfernen Sie leere Felder aus den Pivot-Tabellen
-
2
Wie würde ein Outlook 2007-Makro zum Automatisieren des Einfügevorgangs - unformatierter Text ausseh...
-
4
Öffnen Sie mehrere Instanzen von Excel ohne PERSONAL.xlsb-Sperrnachricht
-
5
Wählen Sie eine gesamte Spalte ohne Kopfzeile in einem Excel-Makro aus
-
1
Stellen Sie das Blattschutzkennwort in Excel wieder her
-
2
Excel VBA: So löschen Sie eine Auswahl, ohne das Arbeitsblatt zu aktivieren
-
1
in Excel 2002 eine Zeichenfolge links von allen Zellen einer Spalte anhängen?
-
2
Makro zum Öffnen von Excel-Hyperlinks