Office Solutions Archive

Maybe you’ve created a great number of subfolders under a certain folder, such as Inbox, in your Outlook. In this case, if you want to count the subfolders, you must be reluctant to counting manually. Here we will share you a far smarter way.

Quickly Get the Total Count of Subfolders under a Specific Folder in Outlook

To better classify and archive items in Outlook, many users are accustomed to creating various folders and subfolders. Yet, afterwards, they may think it a little bit difficult to manage too many folders. In this case, they may want to count how many subfolders there are under a specific folder. Without any doubts, it is stupid and tedious to count manually. Therefore, in the followings, we will show a much more intelligent means.

Get the Total Count of Subfolders under a Specific Folder

  1. At the very outset, start your Outlook program.
  2. Then, in the Outlook window, you can press “Alt + F11” key buttons to access VBA editor.
  3. Next, in the subsequently popup window, you need to open a module that is not being used.
  4. Subsequently, copy and paste the following VBA code into this module.
Sub CountSubfoldersUnderRootFolder()
    Dim objRootFolder As Folder
    Dim lFolderCount As Long
    Dim objFolder As Object
 
    'Get the current folder
    Set objRootFolder = Outlook.Application.ActiveExplorer.CurrentFolder
    'If you want to select, use the following line instead
    'Set objRootFolder = Outlook.Application.Session.PickFolder
 
    If objRootFolder.Folders.count > 0 Then
       For Each objFolder In objRootFolder.Folders
           'Exclude the hidden folders under Inbox
           If objFolder.Name <> "Conversation Action Settings" And objFolder.Name <> "Quick Step Settings" Then
              lFolderCount = lFolderCount + 1
 
              'Process subfolders recursively
              Call ProcessFolders(objFolder, lFolderCount)
           End If
       Next
       MsgBox lFolderCount & " subfolders under " & Chr(34) & objRootFolder.Name & Chr(34) & ".", vbInformation
    Else
       MsgBox "No subfolders under " & Chr(34) & objRootFolder.Name & Chr(34) & ".", vbInformation
    End If
End Sub
 
Sub ProcessFolders(objCurrentFolder As Object, lCount As Long)
    Dim objSubfolder As Object
 
    lCount = lCount + objCurrentFolder.Folders.count
 
    For Each objSubfolder In objCurrentFolder.Folders
        Call ProcessFolders(objSubfolder, lCount)
    Next
End Sub

VBA Code - Get the Total Count of Subfolders under a Specific Folder

  1. After that, you can exit the current window.
  2. Later, go to “File” > “Options” > “Quick Access Toolbar”. There you can add the new macro to Quick Access Toolbar.
  3. Finally, you can try this macro.
  • First off, select a folder whose subfolders you would like to count.
  • Then, click the macro button in Quick Access Toolbar.Run Macro
  • Immediately, Outlook will run this macro.
  • After the macro finishes, you will get a message, like the following image:Message Prompting Total Count of Subfolders

Tricks Coping with Outlook Corruption

Outlook is blazing vulnerable to a plenty of factors, including viruses, software or hardware issues, power outage and so on. No one can guarantee that they’re able to keep their Outlook file far away from corruption. Hence, it’s essential to master some tricks coping with damage. Firstly, you have to make regular PST backup. In addition, you should know how to utilize Scanpst, the inbuilt repair tool. Last but not least, you ought to prepare a more robust external tool, such as DataNumen Outlook repair.

Author Introduction:

Shirley Zhang is a data recovery expert in DataNumen, Inc., which is the world leader in data recovery technologies, including mdf fix and outlook repair software products. For more information visit www.datanumen.com

Be the first to comment

Email internet headers contain a list of IP addresses exposing how this email gets to your mailbox. In some special cases, you may want to forward an email with its full internet headers to someone so as to inquire its real sources. This article will show you 2 means.

At times, you may need to get a mail’s internet headers in Outlook. For example, you need to report possible phishing or spam or you want to survey the detailed sources of an email. At that point, you may wish to forward this mail as well as its full internet headers to someone specialized in analyzing email source. Therefore, here we will introduce you 2 methods to accomplish it.

Quickly Forward an Outlook Email with Its Full Internet Headers

Method 1: Forward an Email with Its Full Internet Headers Manually

  1. To start with, you should double click the source email to open it in Message window.
  2. Then, in the Message window, you need to hit the “File” button in the top left corner.
  3. Next, in the “File” menu, you ought to locate and hit the “Properties” button.
  4. Subsequently, the “Properties” dialog box will display.
  5. In this dialog box, you should select all the “Internet Headers” and press “Ctrl + C” to copy it.Copy Internet Headers in Properties
  6. After that, close this dialog box.
  7. And then, after backing to the email, you should click the “Forward” button in the ribbon.
  8. In the new forwarding email, you can paste the copied full Internet Headers into the message body by pressing “Ctrl + V” keys.
  9. Finally, add the recipients and hit “Send” button.

Method 2: Forward an Email with Its Full Internet Headers via VBA

  1. First off, select or open the source email.
  2. Next, in the Outlook window, tap on “Alt + F11” key buttons.
  3. Then, in the VBA editor window, you can copy the following VBA code into an unused module.
Sub ForwardEmailwithFullInternetHeaders()
    Dim objMail As Outlook.MailItem
    Dim objPropertyAccessor As Outlook.propertyAccessor
    Dim strHeader As String
    Dim strTempFolder As String
    Dim objFileSystem As Object
    Dim strTextFile As String
    Dim objTextFile As Object
    Dim objForward As Outlook.MailItem
 
    Select Case Outlook.Application.ActiveWindow.Class
           Case olInspector
                Set objMail = ActiveInspector.currentItem
           Case olExplorer
                Set objMail = ActiveExplorer.Selection.Item(1)
    End Select
 
    'Get the Internet Headers
    Set objPropertyAccessor = objMail.propertyAccessor
    strHeader = objPropertyAccessor.GetProperty("http://schemas.microsoft.com/mapi/proptag/0x007D001E")
 
    'Input the Internet Headers to a Text File
    strTempFolder = Environ("Temp")
    Set objFileSystem = CreateObject("Scripting.FileSystemObject")
    strTextFile = strTempFolder & "\Internet Headers.txt"
    Set objTextFile = objFileSystem.CreateTextFile(strTextFile)
    objTextFile.Write strHeader
    objTextFile.Close
 
    'Forward this email
    Set objForward = objMail.Forward
    With objForward
         .To = "someone@datanumen.com"
         'Attach the Text file
         .attachments.Add (strTextFile)
         .Display
    End With
 
    Kill strTextFile
End Sub

VBA Code - Forward an Email with Its Full Internet Headers

  1. Finally, you can trigger this macro. Pres “F5” key button in this module.
  2. At once, a new email will display, which is a forwarding email. Also, there is a text file attached, which is recording the Internet headers.Forwarding Email

Too Many Dangers around Outlook

MS Outlook is aimed at being an excellent email client. Hence, it provides users with various functions. Yet, meanwhile, more dangers are also surrounding it. For instance, it can get corrupted very easily. Therefore, users have to keep a potent and specialized repair tool in vicinity, like DataNumen Outlook Repair, by which users could repair PST files like a breeze.

Author Introduction:

Shirley Zhang is a data recovery expert in DataNumen, Inc., which is the world leader in data recovery technologies, including sql corruption and outlook repair software products. For more information visit www.datanumen.com

Be the first to comment

If you never accept the meeting invitations from the senders whose email domain is not same as yours, you may hope that Outlook can auto decline the invitations from those outside your domain. This article will guide you how to achieve this via VBA.

As we all know, in most cases, the email addresses of staff in the same company are in the same domain. Under this circumstance, many users hope that Outlook can auto decline the meeting invitations from those outside their email domains. It is because such meetings generally are not organized by their companies. Now, in the followings, we’ll expose a piece of VBA code, which can realize this feature with effortless ease.

Auto Decline Meeting Invitations from Those Outside Your Domain in Outlook

Auto Decline Meeting Invitations from Those Outside Your Domain

  1. At the very beginning, start your Outlook application.
  2. Then, after accessing Outlook window, you should tap on the “Alt + F11” keys.
  3. Next, the Outlook VBA editor window will display, in which you need to open the “ThisOutlookSession” project.
  4. Subsequently, copy and paste the following VBA code into this project.
Public WithEvents objItems As Outlook.Items

Private Sub Application_Startup()
    Set objItems = Application.Session.GetDefaultFolder(olFolderInbox).Items
End Sub

Private Sub objItems_ItemAdd(ByVal Item As Object)
    Dim objMeetingInvitation As MeetingItem
    Dim strSenderAddress As String
    Dim strSenderDomain As String
    Dim objMeeting As AppointmentItem
    Dim objMeetingResponse As MeetingItem
 
    If TypeName(Item) = "MeetingItem" Then
       Set objMeetingInvitation = Item
 
       'Get sender's email domain
       strSenderAddress = objMeetingInvitation.SenderEmailAddress
       strSenderDomain = Right(strSenderAddress, Len(strSenderAddress) - InStr(strSenderAddress, "@"))
  
       'If not same as your mail domain
       If strSenderDomain <> "datanumen.com" Then
          Set objMeeting = objMeetingInvitation.GetAssociatedAppointment(True)
 
          'Decline it
          Set objMeetingResponse = objMeeting.Respond(olMeetingDeclined)
          objMeetingResponse.Send
          objMeetingInvitation.Delete
       End If
    End If
End Sub

VBA Code - Auto Decline Meeting Invitations from Those Outside Your Domain

  1. After that, you should sign this code. Click the “Tools” in menu bar and select “Digital Signature” from the drop down list. Then, in the newly popup dialog box, just follow onscreen instructions.
  2. Finally, you’re required to restart your Outlook program, which can activate the new VBA project.
  3. From now on, Outlook will check every incoming meeting invitation. If it is from outside your email domain, Outlook will auto decline it and remove the meeting invitation from your calendar.

Outlook Cannot Be Free from Crash

Though Outlook has many excellent abilities, it still can’t be immune from crash. It means that your Outlook data file is vulnerable and can be attacked by various dangers easily. Thus, you have to back up your Outlook file at regular interval. In addition, it is prudent and advisable to prepare an experienced and powerful PST fix tool, such as DataNumen Outlook Repair, which specializes in repairing PST.

Author Introduction:

Shirley Zhang is a data recovery expert in DataNumen, Inc., which is the world leader in data recovery technologies, including recover sql and outlook repair software products. For more information visit www.datanumen.com

Be the first to comment