How to find and replace Subject line in Outlook meetings?

Posted on 2010-08-26
Last Modified: 2012-05-10
I have several dozen Outlook meetings that I need to change some of the words in the Subject from DocReview Reminder: to DocReview Completed:
Question by:Alex972
  • 5
  • 5
LVL 76

Expert Comment

by:David Lee
ID: 33533166
Hi, Alex972.

There are two possible solutions.  

1.  Search for the items with the subject and when the list of matches appears open each one in turn and change the subject.
2.  Use a script that does the work for you.  

I can help with the script if you want to go that route.

Author Comment

ID: 33533247
I would want to use a script, but don't know how to write them.
LVL 76

Expert Comment

by:David Lee
ID: 33533286
No problem.  I do know how to write them.  I just wanted to make sure that a script was okay before taking the time to write one.  I'll get the script together and post it as soon as I can.

Author Comment

ID: 33533561
Thanks, that would be great.
LVL 76

Accepted Solution

David Lee earned 500 total points
ID: 33547752
Here's the code.  Follow these instructions to add it to Outlook.

1.  Start Outlook
2.  Click Tools > Macro > Visual Basic Editor
3.  If not already expanded, expand Microsoft Office Outlook Objects
4.  If not already expanded, expand Modules
5.  Select an existing module (e.g. Module1) by double-clicking on it or create a new module by right-clicking Modules and selecting Insert > Module.
6.  Copy the code from the Code Snippet box and paste it into the right-hand pane of Outlook's VB Editor window
7.  Click the diskette icon on the toolbar to save the changes
8.  Close the VB Editor

To use the code

1.  Select the folder containing the items you want to change (the code doesn't just work on calendars).
2.  Run the macro.
3.  Enter the text to search for (this is case sensitive).
4.  Enter the replacement text (this is also case sensitive).
5.  The code will run and display a dialog box at the end letting you know how many replacements it made.
Sub SearchAndReplaceSubject()
    Const MACRO_NAME = "Search and Replace Subject"
    Dim olkItem As Object, strFind As String, strReplace As String, intCount As Integer
    strFind = InputBox("Enter the text to find", MACRO_NAME)
    If strFind <> "" Then
        strReplace = InputBox("Enter the text that will replace """ & strFind & """.", MACRO_NAME)
        For Each olkItem In Application.ActiveExplorer.CurrentFolder.Items
            If InStr(1, olkItem.Subject, strFind) Then
                olkItem.Subject = Replace(olkItem.Subject, strFind, strReplace)
                intCount = intCount + 1
            End If
    End If
    Set olkItem = Nothing
    msgbox "Find: " & strFind & vbCrLf _
        & "Replace: " & strReplace & vbCrLf _
        & "The macro found and replaced " & intCount & " instances.", vbInformation + vbOKOnly, MACRO_NAME
End Sub

Open in new window

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.


Author Comment

ID: 33550095
Will try on Monday when I get back to work.  

Author Comment

ID: 33550096
LVL 76

Expert Comment

by:David Lee
ID: 33550341
You're welcome.

Author Closing Comment

ID: 33560737
Very useful. Thanks
LVL 76

Expert Comment

by:David Lee
ID: 33562838
No problem.  Glad I could help.

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
How to synch Office 365 with AD in hybrid mode? 7 35
outlook 15 44
Outlook Apps on Andriod 1 26
Outlook 2016 Can't Open Links 1 20
Resolve DNS query failed errors for Exchange
Sometimes Outlook might have problems sending a message. There may be various causes- corrupted PST, AV scanner etc. The message, instead of going to the Sent Items folder, sits in the Outbox indefinitely. To remove it you can use a free tool cal…
This Experts Exchange video Micro Tutorial shows how to tell Microsoft Office that a word is NOT spelled correctly. Microsoft Office has a built-in, main dictionary that is shared by Office apps, including Excel, Outlook, PowerPoint, and Word. When …
To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now