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 / April 2005

Tip: Looking for answers? Try searching our database.

Find and Replace

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
SCrowley - 28 Apr 2005 16:34 GMT
Oultook 2003

I have a large Public folder for contacts and I'd like to be able to
programmatically "find and replace". Example - find all "building" and
replace with "Bldg." find all "Street" and replace with "St."

Is this possible?

Signature

Thank you,
scrowley@littleonline.com

Eric Legault [MVP - Outlook] - 28 Apr 2005 22:16 GMT
Yes, this is certainly possible.  Get a reference to the MAPIFolder object
for that Public Folder, and then use the Restrict method on the
MAPIFolder.Items collection to get a new Items collection containing just
those objects that match your restriction criteria.  Loop through the
collection to obtain individual ContactItem objects, use Instr or Replace
functions on the properties you wish to modify, and then call the Save method.

See the entry for the Restrict method in the Outlook VBA help file for more
info (somewhere like "C:\Program Files\Microsoft Office
2003\OFFICE11\1033\VBAOL11.CHM"), or go to http://www.outlookcode.com for
more code samples.

Signature

Eric Legault - B.A, MCP, MCSD, Outlook MVP
--------------------------------------------------
{Private e-mails ignored}
Job: http://www.imaginets.com
Blog: http://blogs.officezealot.com/legault/

> Oultook 2003
>
[quoted text clipped - 3 lines]
>
> Is this possible?
SCrowley - 29 Apr 2005 14:24 GMT
Thank you Eric. I will read, digest and apply then I'll let you know how I
did.
Signature

Thank you,
scrowley@littleonline.com

> Yes, this is certainly possible.  Get a reference to the MAPIFolder object
> for that Public Folder, and then use the Restrict method on the
[quoted text clipped - 15 lines]
> >
> > Is this possible?
 
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.