Outlook Solutions Archive

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

If you need to send a great number of contacts to someone via email, you may want to pack and compress these contacts into a zip file. In this article, we will introduce a quick method to you.

At times, you may be required to forward multiple contacts to someone via a mail. In this case, if there are hundreds of contacts to be sent, you may want to pack and attach them as a zip file to an email, instead of attaching them separately to an email. So, here we will share a quick means with you.

Pack & Attach Multiple Contacts to an Email

  1. For a start, launch Outlook application.
  2. Then, trigger Outlook VBA editor according to “How to Run VBA Code in Your Outlook“.
  3. Next, put the following code into an unused module.
Sub PackAttachMultipleContactsToEmail()
    Dim objSelection As Outlook.Selection
    Dim objItem As Object
    Dim objContact As Outlook.ContactItem
    Dim strFullName As String
    Dim varTempFolder As Variant
    Dim varZipFile As Variant
    Dim objShell As Object
    Dim objFileSystem As Object
    Dim objMail As Outlook.MailItem

    'Get the selected contacts
    Set objSelection = Outlook.Application.ActiveExplorer.Selection
 
    If Not (objSelection Is Nothing) Then
       'Create a temp folder
       varTempFolder = "E:\TempContacts" & Format(Now, "YYMMDDHHMMSS")
       MkDir (varTempFolder)
       varTempFolder = varTempFolder & "\"

       'Save each Contact as vCard file
       For Each objItem In objSelection
           If TypeOf objItem Is ContactItem Then
              Set objContact = objItem
              strFullName = objContact.FullName

              objContact.SaveAs varTempFolder & strFullName & ".vcf", olVCard
           End If
       Next

       'Create a ZIP file
       varZipFile = "E:\Contacts.zip"
       Open varZipFile For Output As #1
       Print #1, Chr$(80) & Chr$(75) & Chr$(5) & Chr$(6) & String(18, 0)
       Close #1

       'Add the exported vcard files to the ZIP file
       Set objShell = CreateObject("Shell.Application")
       objShell.NameSpace(varZipFile).CopyHere objShell.NameSpace(varTempFolder).Items

       On Error Resume Next
       Do Until objShell.NameSpace(varZipFile).Items.Count = objShell.NameSpace(varTempFolder).Items.Count
          Application.Wait (Now + TimeValue("0:00:01"))
       Loop
       On Error GoTo 0

       Set objFileSystem = CreateObject("Scripting.FileSystemObject")
       objFileSystem.DeleteFolder Left(varTempFolder, Len(varTempFolder) - 1)

       'Attach the zip file to the new email
       Set objMail = Application.CreateItem(olMailItem)
       objMail.Attachments.Add varZipFile
       objMail.Display
    End If
End Sub

VBA Code - Pack & Attach Multiple Contacts to an Email

  1. After that, add this macro to Quick Access Toolbar or ribbon.
  2. Finally, take the steps below to have a try.
  • Frist off, select the contacts that you want.
  • Then, hit the macro button in Quick Access Toolbar or ribbon.Click Macro Button
  • At once, a new mail will display, in which you can see the attached zip file called “Contacts”, as shown in the following figure.Attached ZIP File in Email

Prepare a Powerful PST Fix Tool

Since Outlook data file is prone to corruption, you need to learn some ways to fix PST file. First, you can try Scanpst, the inbox repair utility. However, in the event of severe PST damage, you have to resort to a more robust tool, 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 recover Sql Server and outlook repair software products. For more information visit www.datanumen.com