Share via

How do I reset Outlook 365 Visual Basic Editor

Anonymous
2024-04-18T15:15:15+00:00

Outlook 365 is showing email count in each folder; however, several folders are empty and still shows a count.

I have tried to re-enter the VBA code that is to show email count in each folder, but it keeps coming back with errors.

  1. I would like to reset Outlook 365 Visual Basic Editor back to normal status
  2. I would like to reset VBA not show any email count in each folder.
  3. I would like to get a code to show email count in each folder for future use.

I appreciate your response.

Microsoft 365 and Office | Install, redeem, activate | For home | Other

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

1 answer

Sort by: Most helpful
  1. Anonymous
    2024-04-18T16:00:13+00:00

    Hello, NormanRockwell1

    Thank you for reaching out Microsoft Community. I am an advisor that can provide help regarding Microsoft Office 365 concerns. I totally understand that you wish to reset your Outlook 365 Visual Basic editor and set it to default or normal status. Let me help you with it.

    To reset the Outlook 365 Visual Basic Editor;

    Open Outlook 365 > press ALT + F11 to open Visual Basic editor. From there, go to the menu and select Tools > select Options.

    Look for the Reset option under the Option dialog box. Select it and click "Okay" to apply the changes.

    If you wish to reset VBA not show any email count in each folder, please do these steps:

    On your VBA editor, Locate the module or script that contains the code for showing email counts in each folder. Delete or comment out the code responsible for displaying the email counts. You can comment out a line of code by adding a single quote ( ' ) at the beginning of the line. Save your changes and close the VBA editor.

    Lastly, Here's the code to show email count in each folder. Please copy and save it in your notes or Outlook draft.

    Sub ShowEmailCount() Dim objFolder As Outlook.Folder Dim objSubFolder As Outlook.Folder Dim objExplorer As Outlook.Explorer Dim strMessage As String

    Set objExplorer = Application.ActiveExplorer

    For Each objFolder In objExplorer.CurrentFolder.Folders If objFolder.DefaultItemType = olMailItem Then strMessage = "Folder: " & objFolder.Name & vbTab & "Email Count: " & objFolder.Items.Count Debug.Print strMessage ' You can output the message to the Immediate Window (Ctrl + G) or modify to display in a message box. End If Next objFolder End Sub

    You can run this macro to display the email count in each folder. Make sure to enable macros in Outlook and then run the macro using the Developer tab or by assigning it to a button.

    Please let me know if these information answered the concern and helped us to resolve the issue. Give back to the Community. Help the next person who has this issue by indicating if this reply solved your problem. Click Yes or No below.

    Kind regards, Kevin

    Was this answer helpful?

    0 comments No comments