Outlook Solutions Archive

If an Outlook task contains many attachments, to extract and save them to a local folder, in general, you have to save them one by one manually. Yet, in this article, we will introduce a method to batch save all attachments in one go.

At times, you may receive a task assigned from someone else. And this task may contain several important attachments in its body. In face of such a task, you may need to extract and save these attachments to a Windows folder. Yet, unlike email, you cannot save them in batches by default. Outlook only allows you to save one by one. Obviously, it will be too tedious if there are too many attachments. Hence, here we will introduce a way to let you accomplish this task in bulk.

Batch Save All Attachments in a Task to a Windows Folder

  1. At the very outset, launch Outlook application.
  2. Then, trigger Outlook VBA editor with reference to “How to Run VBA Code in Your Outlook“.
  3. Next, copy the following code into an unused module.
Sub BatchSaveAttachmentsFromTask()
    Dim objTask As Outlook.TaskItem
    Dim objShell, objWindowsFolder As Object
    Dim strWindowsFolder As String
    Dim objAttachment As Outlook.Attachment
    Dim strFolder, strFilePath As String

    'Get the task
    Select Case Outlook.Application.ActiveWindow.Class
           Case olInspector
                Set objTask = ActiveInspector.CurrentItem
           Case olExplorer
                Set objTask = ActiveExplorer.Selection.Item(1)
    End Select

    'Select a Windows folder for saving extracted attachments
    Set objShell = CreateObject("Shell.Application")
    Set objWindowsFolder = objShell.BrowseForFolder(0, "Select a folder to save Tasks' attachments:", 0, "")

    If Not objWindowsFolder Is Nothing Then
       strWindowsFolder = objWindowsFolder.self.Path & "\"

       If objTask.Attachments.Count > 0 Then

          For Each objAttachment In objTask.Attachments
              strFilePath = strWindowsFolder & objAttachment.FileName
              objAttachment.SaveAsFile strFilePath
          Next
       End If

       Shell "Explorer.exe" & " " & strWindowsFolder, vbNormalFocus
    End If
End Sub

VBA Code - Batch Save All Attachments in a Task to a Windows Folder

  1. Subsequently, exit the VBA editor.
  2. After that, add this macro to Quick Access Toolbar or ribbon.
  3. Eventually, you can have a try.
  • First off, select or open a task.
  • Then, click the newly added macro button.Run Macro on Task
  • In the popup dialog box, select a Windows folder as per your needs.
  • Afterwards, click “OK”.Select Windows Folder
  • At once, the Windows folder will be displayed, in which you can find the extracted attachments.Saved Attachments

Cope with Disturbing Outlook Issues

As we all know, Outlook PST file is susceptible to various errors and corruption. For instance, if you frequently close your Outlook improperly or you download any malicious files, your Outlook PST file may become inaccessible one day. At that time, even the inbox repair tool is unable to help you. What you can resort to is more experienced and trustworthy PST fix software, like DataNumen Outlook Repair. It can extract maximum Outlook data from a PST file in quick time.

Author Introduction:

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

Some users often need to export the specific incoming emails as Word documents. In this article, we will introduce a method that can configure Outlook to automatically accomplish this task.

In general, for the extremely important emails, users are accustomed to storing them in the local folder as a text file or Word document. Unquestionably, it is too troublesome to export the vital emails manually every time. Therefore, here we’ll share an approach which can let Outlook auto get it.

Auto Export the Specific Incoming Emails as Word documents

  1. At the beginning, launch Outlook application.
  2. Then, access VBA editor by reading “How to Run VBA Code in Your Outlook“.
  3. Next, copy the following code into a module.
Sub ExportEmailBodyToWordDoc(objMail As Outlook.MailItem)
    Dim strFolder As String
    Dim strSubject As String
    Dim strFile As String

    'Change the path to the specific Windows folder
    strFolder = "E:\Emails"

    If objMail.Subject <> "" Then

       'Remove unsupported characters in subject
       strSubject = objMail.Subject
       strSubject = Replace(strSubject, "/", " ")
       strSubject = Replace(strSubject, "\", " ")
       strSubject = Replace(strSubject, ":", "")
       strSubject = Replace(strSubject, "?", " ")
       strSubject = Replace(strSubject, Chr(34), " ")

       strFile = strFolder & "\" & objMail.Subject & ".doc"
       objMail.SaveAs strFile, olDoc
    End If
End Sub

VBA Code - Auto Export the Specific Incoming Emails as Word documents

  1. In the code, change the path of specific Windows folder to save the exported Word documents.
  2. Later, exit VBA editor.
  3. Subsequently, go to “File” and click “Manage Rules & Alerts” button.
  4. In the “Rules and Alerts” window, click “New Rule” button.
  5. Then, in “Rules Wizard”, select “Apply rule on messages I receive” and hit “Next”.Create New Rule
  6. Next, set the conditions of specific incoming emails as per your needs, such as from specific persons or groups.Set Rule Conditions
  7. After that, in “Select action(s)” step, select “run a script”.
  8. Then, click “script” and select the previously added macro.Select Rule Action
  9. Lastly, follow the onscreen instructions to finish rule setup.
  10. From now on, every time a specific incoming email arrives in your mailbox, it will be automatically exported as a Word document in the predefined folder.Auto Exported Emails in Word Documents

Fix Corrupted Outlook PST Files

Like other software, Outlook can crash now and then. Every time when it crashes, Outlook PST file is actually in danger of corruption. Therefore, it is quite difficult to predict and prevent PST corruption. What users can do is backing up Outlook PST files at regular intervals and keeping a cutting-edge PST repair tool, such as DataNumen Outlook Repair, which can repair PST file 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 repair SQL Server and outlook repair software products. For more information visit www.datanumen.com

In order to distinguish private items and non-private items in calendar more easily, you may wish to auto show private items in a specific color, such as red to highlight them. This post will introduce 2 ways to realize it.

Many users prefer to classify calendar items based on whether they are private or not. Since, in calendar, private items have no manifest differences in vision by default, so as to identify private items much more easily, you can let Outlook auto show them in a specific color. Here we will teach you 2 approaches to get it.

Method 1: Use “Conditional Formatting”

  1. For a start, launch Outlook and access “Calendar” pane.
  2. Then, turn to “View” tab and change view to “Calendar”.Calendar View
  3. Next, hit “View Settings” button.
  4. In the popup dialog box, click “Conditional Formatting”.Conditional Formatting
  5. Later, in the subsequent dialog, click “Add” and enter a name, like “Private”.
  6. Then, select a specific color, like “Dark Red” for my instance.Select Conditional Formatting Color
  7. After that, click “Condition” button.
  8. In the next dialog box, switch to “Advanced” tab and add the following filter:
Sensitivity > equals > private

Set Select Conditional Formatting Color Filter

  1. Finally, click “Add to List” and several “OK” to save this formatting rule.
  2. From now on, all the private calendar items will be shown in “Dark Red”.Private Items in Dark Color

Method 2: Use “Auto Color Categorize” in VBA

  1. First off, create a new color category called “Private” with a specific color.
  2. Next, launch Outlook VBA editor according to “How to Run VBA Code in Your Outlook“.
  3. Then, put the following code into “ThisOutlookSession” project.
Private WithEvents objCalendarItems As Outlook.Items

Private Sub Application_Startup()
     Set objCalendarItems = Outlook.Application.Session.GetDefaultFolder(olFolderCalendar).Items
End Sub

Private Sub objCalendarItems_ItemAdd(ByVal Item As Object)
    Dim objCalendarItem As Outlook.AppointmentItem

    Set objCalendarItem = Item

    If objCalendarItem.Sensitivity = olPrivate Then
       objCalendarItem.Categories = "Private"
    Else
       Call RemovePrivateCategory(objCalendarItem, "Private")
    End If

    objCalendarItem.Save
End Sub

Private Sub objCalendarItems_ItemChange(ByVal Item As Object)
    Dim objCalendarItem As Outlook.AppointmentItem

    Set objCalendarItem = Item

    If objCalendarItem.Sensitivity = olPrivate Then
       objCalendarItem.Categories = "Private"
    Else
       Call RemovePrivateCategory(objCalendarItem, "Private")
    End If

    objCalendarItem.Save
End Sub

Sub RemovePrivateCategory(ByVal objCurrentItem As Object, ByRef strCategory As String)
    Dim varCategories As Variant
    Dim i As Long

    varCategories = Split(objCurrentItem.Categories, ",")

    If UBound(varCategories) >= 0 Then
       For i = 0 To UBound(varCategories)
           If Trim(varCategories(i)) = strCategory Then
              varCategories(i) = ""
              objCurrentItem.Categories = Join(varCategories, ",")
              Exit Sub
           End If
      Next
    End If
End Sub

VBA Code - Auto Show Private Calendar Items in a Specific Color

  1. Eventually, restart Outlook to activate this macro.
  2. Now, you can have a try.
  • Pitch on an item in the default calendar.
  • Then, change it to “Private”.Change a Calendar Item to Private
  • At once, “Private” color category will be assigned to this item, as shown in the following screenshot.Auto Assigned "Private" Color Category

Rescue Your Valuable Outlook Data

Since Outlook is vulnerable, many users have been ever subject to PST corruption. In general, when encountering it, you can first try the inbox repair tool to fix the file. Yet, if it fails, you can resort to a more potent and reliable external utility, like 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 sql corruption and outlook repair software products. For more information visit www.datanumen.com