I Outlook 폴더의 전자 메일 수를 계산하려면 다음 코드를 사용하십시오.날짜 별 Outlook의 전자 메일 계산
Sub HowManyEmails()
Dim objOutlook As Object,
objnSpace As Object,
objFolder As Object
Dim EmailCount As Integer
Set objOutlook = CreateObject("Outlook.Application")
Set objnSpace = objOutlook.GetNamespace("MAPI")
On Error Resume Next
Set objFolder = objnSpace.Folders("Personal Folders").Folders("Inbox").Folders("report's").Folders("Customer")
If Err.Number <> 0 Then
Err.Clear
MsgBox "No such folder."
Exit Sub
End If
EmailCount = objFolder.Items.Count
Set objFolder = Nothing
Set objnSpace = Nothing
Set objOutlook = Nothing
MsgBox "Number of emails in the folder: " & EmailCount, , "email count" End Sub
나는이 폴더의 이메일을 날짜별로 계산하려고하므로 매일 계산됩니다.
이 분명 밤은 [태그 : VBScript를를] - 당신은 VBA의 Outlook 내부에서 의미합니까? – brettdj
Excel에 연결하거나 ADO를 사용하여 쿼리를 실행하는 것이 더 쉽습니다. http://support.microsoft.com/kb/275262 – Fionnuala