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

Kako prešteti število map pod določenim e-poštnim računom ali vsemi nabiralniki v Outlooku?

Ta članek govori o štetju števila map pod določenim e-poštnim računom ali vseh nabiralnikov v Outlooku.

Štejte število map pod določenim e-poštnim računom ali vse nabiralnike s kodo VBA

Kartica Office Omogočite urejanje in brskanje z zavihki v storitvi Office ter olajšajte svoje delo ...
Kutools za Excel rešuje večino vaših težav in poveča produktivnost za 80%
  • Ponovno uporabi vse: Med priljubljene dodajte najbolj uporabljene ali zapletene formule, grafikone in kar koli drugega ter jih v prihodnosti hitro ponovno uporabite.
  • Več kot 20 besedilnih funkcij: Izvleček številke iz besedilnega niza; Izvleči ali odstrani del besedil; Pretvorite številke in valute v angleške besede.
  • Združi orodja: Več delovnih zvezkov in listov v eno; Združi več celic / vrstic / stolpcev brez izgube podatkov; Združi podvojene vrstice in vsoto.
  • Razdeljena orodja: Razdeli podatke na več listov na podlagi vrednosti; En delovni zvezek v več datotek Excel, PDF ali CSV; En stolpec na več stolpcev.
  • Prilepi preskoči Skrite / filtrirane vrstice; Štetje in vsota glede na Barva ozadja; V večjem obsegu pošiljajte osebna e-poštna sporočila več prejemnikom.
  • Super filter: Ustvarite napredne filtrirne sheme in uporabite za vse liste; Razvrščanje po tednih, dnevih, pogostosti in še več; filter s krepkim tiskom, formule, komentar ...
  • Več kot 300 zmogljivih funkcij; Deluje s sistemoma Office 2007-2019 in 365; Podpira vse jezike; Preprosta namestitev v vašem podjetju ali organizaciji.

Štejte število map pod določenim e-poštnim računom ali vse nabiralnike s kodo VBA

Štete lahko število map pod določenim e-poštnim računom ali vse nabiralnike s spodnjo kodo VBA. Naredite naslednje.

1. Pritisnite druga + F11 tipke za odpiranje Microsoft Visual Basic za aplikacije okno.

2. V Ljubljani Microsoft Visual Basic za aplikacije okno, kliknite Vstavi > Uporabniška oblika. Oglejte si posnetek zaslona:

3. Nato vstavite dve Gumbi možnosti in dva Ukazni gumbi v Uporabniški obrazec 1in spremenite prikazno besedilo gumbov, kot je prikazano spodaj.

4. Spremenite ime prvega gumba možnosti v “opbCurAccount"In spremenite vrednost premoženje True. Oglejte si posnetek zaslona:

5. Nadaljujte s spreminjanjem imena drugega gumba možnosti v “opbAllAccounts". Nato določite ime dveh ukaznih gumbov na “cdbOk"In"cdbOdpovedi”Ločeno.

6. Dvokliknite katero koli prazno mesto UserForm1 in nato v oknu Userform1 (Code) zamenjajte prvotno kodo s spodnjo kodo VBA.

Koda VBA: preštejte število map v programu Outlook

Option Explicit
'Update by Extendoffice 20180504
Public xRet As Boolean
Private Sub cdbCancel_Click()
xRet = False
UserForm1.Hide
End Sub
Private Sub cdbOk_Click()
xRet = True
UserForm1.Hide
End Sub
7. Click Insert > Module. Then copy below VBA code into the Module window.
VBA code: Count number of folders in Outlook
Function GetSubFolderCount(ParentFolder As Folder) As Long
    Dim xSubFolders As Folders
    Dim xCurFolder As Outlook.Folder
    Dim xFoldersCount As Integer
    On Error Resume Next
    Set xSubFolders = ParentFolder.Folders
    If xSubFolders.Count > 0 Then
       Set xCurFolder = xSubFolders.GetFirst
       While TypeName(xCurFolder) = "MAPIFolder"
          xFoldersCount = xFoldersCount + GetSubFolderCount(xCurFolder)
         Set xCurFolder = xSubFolders.GetNext
       Wend
       GetSubFolderCount = xFoldersCount + xSubFolders.Count
    Else
        GetSubFolderCount = 0
    End If
    End Function
    
    Sub CountFoldersInOutlook()
    Dim xNameSpace As NameSpace
    Dim xFolder As Folder
    Dim xAllFoldersCount As Long
    On Error Resume Next
    UserForm1.Show
    If UserForm1.xRet Then
        Set xNameSpace = Outlook.Application.Session
        If UserForm1.opbCurAccount.Value Then
            Set xFolder = Outlook.Application.ActiveExplorer.CurrentFolder.Store.GetRootFolder
            xAllFoldersCount = GetSubFolderCount(xFolder)
        ElseIf UserForm1.opbAllAccounts.Value Then
            For Each xFolder In xNameSpace.Folders
                xAllFoldersCount = xAllFoldersCount + GetSubFolderCount(xFolder)
            Next
        End If
    Else
        Exit Sub
    End If
    MsgBox "Total Folders: " & xAllFoldersCount, vbInformation + vbOKOnly, "Kutools for Outlook"
    End Sub

8. Press the F5 key to run the code. Then a UserForm1 dialog box pops up, for counting number of folders in current account, please select the Current Account option and click the OK button. For counting number of folders in all mailboxes, choose the All Accounts option and then click the OK button. See screenshot:

9. Then a Kutools for Outlook dialog box pops up to tell you how many folders existing in current account or all mailboxes as below screenshot. Please click the OK button.

Note: All hidden folders such as the Conversation Action Settings folder and the Quick Step Settings folder are included in the folder counting.


Related articles:


The Best Office Productivity Tools

Kutools for Excel Solves Most of Your Problems, and Increases Your Productivity by 80%

  • Reuse: Quickly insert complex formulas, charts and anything that you have used before; Encrypt Cells with password; Create Mailing List and send emails...
  • Super Formula Bar (easily edit multiple lines of text and formula); Reading Layout (easily read and edit large numbers of cells); Paste to Filtered Range...
  • Merge Cells/Rows/Columns without losing Data; Split Cells Content; Combine Duplicate Rows/Columns... Prevent Duplicate Cells; Compare Ranges...
  • Select Duplicate or Unique Rows; Select Blank Rows (all cells are empty); Super Find and Fuzzy Find in Many Workbooks; Random Select...
  • Exact Copy Multiple Cells without changing formula reference; Auto Create References to Multiple Sheets; Insert Bullets, Check Boxes and more...
  • Extract Text, Add Text, Remove by Position, Remove Space; Create and Print Paging Subtotals; Convert Between Cells Content and Comments...
  • Super Filter (save and apply filter schemes to other sheets); Advanced Sort by month/week/day, frequency and more; Special Filter by bold, italic...
  • Combine Workbooks and WorkSheets; Merge Tables based on key columns; Split Data into Multiple Sheets; Batch Convert xls, xlsx and PDF...
  • More than 300 powerful features. Supports Office/Excel 2007-2019 and 365. Supports all languages. Easy deploying in your enterprise or organization. Full features 30-day free trial. 60-day money back guarantee.
kte tab 201905

Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier

  • Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
  • Open and create multiple documents in new tabs of the same window, rather than in new windows.
  • Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!
officetab bottom
Comments (0)
No ratings yet. Be the first to rate!
There are no comments posted here yet
Leave your comments
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations