Outlook PST 파일의 각 색상 범주에 있는 총 항목 수를 빠르게 얻으려면 이 문서에 표시된 VBA 코드를 사용할 수 있습니다. 편리한 확인을 위해 모든 카운트를 Excel 파일로 직접 내보냅니다.

의심의 여지없이 색상 범주가 많은 경우 이렇게 하면 하나씩 계산하는 것이 매우 지루할 것입니다. 따라서 이 요구 사항에 대한 응답으로 여기에서 훨씬 빠른 방법을 공개합니다. 모든 카운트를 Excel 파일로 바로 내보냅니다.
Outlook의 각 색상 범주에 있는 항목 수를 Excel로 내보내기
- 우선, star당신의 Outlook 응용 프로그램.
- 그런 다음 "Alt + F11"키 버튼을 눌러 Outlook VBA 편집기에 액세스합니다.
- 이어지는 "Microsoft Visual Basic for Applications" 창에서 빈 모듈을 엽니다.
- 다음으로 다음 VBA 코드를 이 모듈 창에 복사할 수 있습니다.
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")
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 = "E:\Outlook\Color Categories (" & Format(Now, "yyyy-mm-dd_hh-mm-ss") & ").xlsx"
objExcelWorkbook.Close True, strExcelFile
MsgBox "Complete!", vbExclamation
End Sub
Private Sub ProcessFolder(ByVal objCurrentFolder As Outlook.Folder)
Dim objItem As Object
Dim objSubFolder As Object
Dim ArrayCategories As Variant
Dim VarCategory As Variant
Dim ArrayKey As Variant
Dim ArrayItem As Variant
Dim i As Long
Dim nRow As Integer
'Count the items in each color category via Dictionary object
For Each objItem In objCurrentFolder.Items
If objItem.Categories <> "" Then
ArrayCategories = Split(objItem.Categories, ",")
For Each VarCategory In ArrayCategories
If objDictionary.Exists(VarCategory) = True Then
objDictionary.Item(VarCategory) = objDictionary.Item(VarCategory) + 1
End If
Next
End If
Next
ArrayKey = objDictionary.Keys
ArrayItem = objDictionary.Items
nRow = 2
'Input the information into the new Excel file
For i = LBound(ArrayKey) To UBound(ArrayKey)
objExcelWorksheet.Cells(nRow, 1) = ArrayKey(i)
objExcelWorksheet.Cells(nRow, 2) = ArrayItem(i) & “ Items”
nRow = nRow + 1
Next
'Process the subfolders recursively
For Each objSubFolder In objCurrentFolder.Folders
ProcessFolder objSubFolder
Next
End Sub
- 그런 다음 Outlook에서 매크로를 허용하는지 확인하십시오.
- 마지막으로 시도해 볼 수 있습니다.
- 먼저 이 새 매크로에서 F5 키 버튼을 누릅니다.
- 그런 다음 원본 PST 파일을 선택하고 "확인"을 눌러야 합니다.
- "완료"라는 메시지가 표시되면 로컬 드라이브로 이동하여 Excel 파일을 저장하기 위해 미리 정의된 폴더를 열 수 있습니다.
- Excel 파일을 찾아 엽니다. 다음 이미지와 같이 표시됩니다.
Outlook이 갑자기 충돌하는 경우 수행할 작업
Outlook에는 여러 가지 강력한 기능이 포함되어 있지만 시간이 지남에 따라 Outlook에서 다양한 문제가 발생하는 경향이 있습니다. 예를 들어 Outlook은 때때로 충돌할 수 있습니다. 기껏해야 입술tarOutlook에서 문제를 해결할 수 있습니다. 최악의 경우 PST 데이터 손상으로 직접 이어질 수 있습니다. 그 때, 당신은 다양한 수단을 사용하여 PST 수리 파일을 사용하여 최대 Outlook 데이터를 얻을 수 있습니다. DataNumen Outlook Repair.
저자 소개 :
Shirley Zhang은 데이터 복구 전문가입니다. DataNumen, Inc.는 다음과 같은 데이터 복구 기술 분야의 세계적 리더입니다. SQL 수리 및 전망 수리 소프트웨어 제품. 자세한 내용은 WWW.datanumen.COM

