Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Outlook / Programming VBA / October 2005

Tip: Looking for answers? Try searching our database.

Code to amend subject lines in a public outlook folder ...

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Rob Keel - 29 Sep 2005 15:41 GMT
Hi,

Can anyone offer a solution to add a defined number of characters to
all email subject fields stored in a public outlook folder please?

ie ... i have a folder full of emails that begin with a number. From
day 1 (due to no forward planning) the subject line of the first email
stored began with "1 XXXXXXXXXXX" ... now 6 months later we are up to
12000 odd and to aid sorting I would like to add "0000" to the
beginning of all subject fields. So 1<space><space>XXXXXXXX becomes
"00001 XXXXXXXXXXX"

Many thanks,

Rob.
Eric Legault [MVP - Outlook] - 05 Oct 2005 20:55 GMT
This should do it (run with the folder containing the items active in Outlook):

   Dim objFolder As Outlook.MAPIFolder
   Dim objItems As Outlook.Items
   Dim objItem As Outlook.MailItem
   
   'Work with the current folder only
   Set objFolder = ActiveExplorer.CurrentFolder
   Set objItems = objFolder.Items
   For Each objItem In objItems
       objItem.Subject = "0000" & objItem.Subject
       objItem.Save
   Next
   
   Set objItem = Nothing
   Set objItems = Nothing
   Set objFolder = Nothing

Signature

Eric Legault (Outlook MVP, MCDBA, old school WOSA MCSD, B.A.)
Try Picture Attachments Wizard for Outlook:
http://www.collaborativeinnovations.ca
Blog: http://blogs.officezealot.com/legault/

> Hi,
>
[quoted text clipped - 11 lines]
>
> Rob.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.