After you import multiple tasks from an external file, if you want to batch change the specific text in the tasks’ subjects, you can utilize the smart “Find & Replace” feature introduced in this article.
Sometimes, you may need to batch change multiple tasks’ subjects. For instance, you received an Excel file that contains a stack of tasks. Thus, you import them to your Outlook and move them to corresponding Task folders. Yet, afterwards, you feel that many tasks’ subjects have specific words that you aren’t familiar with. So, you want to bulk change the words. Under this circumstance, you can utilize the following method. It’ll loop all Tasks folder to find the tasks whose subjects have the specific words and perform replacement.
Batch Find & Replace Text in All Tasks’ Subjects
- At first, launch your Outlook.
- Then, tap on “Alt + F11” buttons to access VBA editor in Outlook.
- Next, in the new window, put the VBA code into a module.
Dim strFind, strReplace As String Sub FindReplaceTextsInAllTaskSubjects() Dim objStore As Outlook.Store Dim objFolder As Outlook.Folder Dim lTotalCount As Long 'Enter the words to find and replacement strFind = InputBox("Type the words to find") strReplace = InputBox("Type the words to replace") If Trim(strFind) <> "" Then lTotalCount = 0 'Process all task folders For Each objStore In Application.Session.Stores For Each objFolder In objStore.GetRootFolder.Folders If objFolder.DefaultItemType = olTaskItem Then Call ProcessTaskFolders(objFolder, lTotalCount) End If Next Next 'Get the Prompt about results MsgBox lTotalCount & " task subjects have been changed!", vbInformation + vbOKOnly End If End Sub Sub ProcessTaskFolders(objTaskFolder As Outlook.Folder, lCount As Long) Dim i As Long Dim objTask As Outlook.TaskItem Dim objSubTaskFolder As Outlook.Folder For i = 1 To objTaskFolder.Items.Count Set objTask = objTaskFolder.Items(i) 'If find the specific words in subjects If InStr(objTask.Subject, strFind) > 0 Then 'Replace objTask.Subject = Replace(objTask.Subject, strFind, strReplace) objTask.Save lCount = lCount + 1 End If Next 'Process all subfolders recursively If objTaskFolder.Folders.Count > 0 Then For Each objSubTaskFolder In objTaskFolder.Folders Call ProcessTaskFolders(objSubTaskFolder, lCount) Next End If End Sub
- Subsequently, you can run this macro right now. Just move cursor in the first subroutine and press “F5” key button.
- Later, you need to input the specific words to find and the replacement.
- Eventually, when macro finishes, you will get a prompt about the results.
- Now, you can check your tasks. The subjects of the tasks that contained the specific words before have been replaced with the new words.
Protect Your Outlook Intelligently
Since PST data recovery is a bit difficult, it is highly recommended to stick to data backups for your Outlook at regular intervals. As long as you hold an up-to-date data backup, even though PST is compromised seriously, you still can restore PST data with effortless ease without needs to care damaged Outlook file. However, if you have no such backup, you have no alternative but to recur to an experienced and remarkable external tool, such as DataNumen Outlook Repair.
Shirley Zhang is a data recovery expert in DataNumen, Inc., which is the world leader in data recovery technologies, inscluding corrupted mdf and outlook repair software products. For more information visit www.datanumen.com