Using VBA to Manipulate Existing Outlook Data

In addition to using VBA to respond to application-level events, you can also use VBA to manipulate the data you've already stored in Outlook. For instance, if you have a large number of contacts who work for ABC Bakery and the company suddenly changes its name to Sweets and Treats, you don't have to manually update every ABC Bakery contact. You can use VBA to perform the update for you.

The following code sets a folder object variable to your Contacts folder, loops through all contacts items, and updates those with a company name of ABC Bakery. You could also adapt this code to change the email addresses, area codes, or File As fields of these contacts.

TIP

Be careful when working with items in the ...

Get Special Edition Using® Microsoft® Office Outlook® 2003 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.