Note: The other languages of the website are Google-translated. Back to English

 Kako odpreti vsa neprebrana e-poštna sporočila v programu Outlook?

Če je v mapi »Prejeto« v Outlooku več neprebranih e-poštnih sporočil, kako lahko odprete vsa, da jih lahko preberete hkrati, kakor hitro je mogoče?

Odprite vsa neprebrana e-poštna sporočila v določeni mapi Prejeto ali drugi mapi s kodo VBA

Odprite vsa neprebrana e-poštna sporočila v določeni mapi Prejeto ali drugi mapi s kodo VBA

Naslednja koda VBA vam lahko pomaga, da hkrati odprete vsa neprebrana e-poštna sporočila v mapi »Prejeto« ali v določeni mapi, tako da sledite spodnjim korakom:

1. Najprej izberite mapo, iz katere želite odpreti vsa neprebrana e-poštna sporočila.

odpiranje vseh neprebranih e-poštnih sporočil 1

2. Nato držite tipko ALT + F11 tipke za odpiranje Microsoft Visual Basic za aplikacije okno.

3. In nato kliknite Vstavi > Moduli, kopirajte in prilepite spodnjo kodo v odprti prazen modul, glejte posnetek zaslona:

Koda VBA: Odprite vsa neprebrana e-poštna sporočila v določeni mapi:

Sub OpenAllUnreadEmails()
Dim xFolders As Outlook.Folders
Dim xFolder As Outlook.Folder
Dim xUnreadEmailCount As Long
On Error Resume Next
xUnreadEmailCount = 0
Set xFolders = Application.ActiveExplorer.CurrentFolder.Folders
Call OperatingFolders(Application.ActiveExplorer.CurrentFolder, xUnreadEmailCount)
For Each xFolder In xFolders
    Call OperatingFolders(xFolder, xUnreadEmailCount)
Next
MsgBox "Open " & xUnreadEmailCount & " unread emails successfully!", vbExclamation + vbOKOnly, "Kutools for Outlook"
End Sub
Sub OperatingFolders(ByVal xCurrentFld As Outlook.Folder, UnreadEmailCount As Long)
Dim xItem As Object
Dim xMailItem As Outlook.MailItem
Dim xSubFolder As Outlook.Folder
On Error Resume Next
If xCurrentFld.DefaultItemType = olMailItem Then
    For Each xItem In xCurrentFld.Items
        If xItem.Class = olMail Then
            Set xMailItem = xItem
            If xMailItem.UnRead = True Then
                xMailItem.Display
                UnreadEmailCount = UnreadEmailCount + 1
            End If
        End If
    Next
End If
If xCurrentFld.Folders.Count > 0 Then
    For Each xSubFolder In xCurrentFld.Folders
        Call OperatingFolders(xSubFolder, UnreadEmailCount)
    Next
End If
End Sub

doc open all unread eamils 2

4. And then, press F5 key to run this code, and all unread emails will be opened in the specified folder at once, at last, a prompt box will pop out to remind the number of unread emails which are opened, see screenshot:

doc open all unread eamils 3

Note: This code is not available for meeting emails.


Kutools for Outlook - Brings 100 Advanced Features to Outlook, and Make Work Much Easier!

  • Auto CC/BCC by rules when sending email; Auto Forward Multiple Emails by custom; Auto Reply without exchange server, and more automatic features...
  • BCC Warning - show message when you try to reply all if your mail address is in the BCC list; Remind When Missing Attachments, and more remind features...
  • Reply (All) With All Attachments in the mail conversation; Reply Many Emails in seconds; Auto Add Greeting when reply; Add Date into subject...
  • Attachment Tools: Manage All Attachments in All Mails, Auto Detach, Compress All, Rename All, Save All... Quick Report, Count Selected Mails...
  • Powerful Junk Emails by custom; Remove Duplicate Mails and Contacts... Enable you to do smarter, faster and better in Outlook.
shot kutools outlook kutools tab 1180x121
shot kutools outlook kutools plus tab 1180x121
 
Comments (1)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
my mails not opening .since 10days. please help me sir.
There are no comments posted here yet
Leave your comments
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations