Setting Mailing Address Checkbox for all contacts in folder

B

Brian

I'm working with Outlook 2002

I have been working on a project to consolidate a number of categories in a
public folder. The easiest way I found was to export the 14,000+ contacts
to an excel spreadsheet and do a find/replace. That part worked just fine.
The first problem I ran into was when I imported the contacts back into a
working folder it changed the File As to Last, First. I found a KB article
(http://support.microsoft.com/?kbid=269172) that stepped me through the
process of making a custom form that changed the File As back to Company
only for all the contacts. Very slick! Here's the other "side-effect" from
the export/import process though... I need to change all the contacts so the
"This is the mailing address" checkbox is checked. I tried to modify the
code to the custom form I built with the help of the MS KB article. Here's
a snippet:

-----------------------

Case "Company"

If MyItem.CompanyName <> "" Then

MyItem.FileAs = MyItem.CompanyName

MyItem.MailingAddressCheckbox = True

Else

MyItem.FileAs = MyItem.LastNameandFirstName

MyItem.MailingAddressCheckbox = True

End IF


-----------------------

I get an error message of: "Object doesn't support this property or method:
'MyItem.MailingAddressCheckbox'".

I hope this all makes sense. I'm hoping someone can help and shed some
light on this. My only alternative is to manually have someone touch all
14000+ contacts. I don't think that is a very good option.

Any help is appreciated.

- Brian
 
S

Sue Mosher [MVP-Outlook]

A ContactItem has no property named MailingAddressCheckbox. Is that
somethign you added? How?
 
B

Brian

I pulled that out of the advanced properties for the "This is the mailing
address" checkbox on the normal contact form but going into design. It was
a stab that apparently missed it's target. ;)

- Brian
 
S

Sue Mosher [MVP-Outlook]

MailingAddressCheckbox is the name of the control, not of a property or
field. You can see the name of the corresponding property on the Value tab
of the control's Properties dialog, but I don't think it will help you.
Since it's just a Yes/No property, it can't tell you whether Home, or
Business or Other is the mailing address.

The field that contains the information about which is the mailing address
is the ContactItem.SelectedMailingAddress property, which can have a value
of 1, 2, or 3, corresponding to Home, Business, or Other.
--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
B

Brian

Thank you Sue. I guess I'm still not sure how to obtain my goal of setting
that checkbox as checked in all the contacts in that folder. Is there a way
of programmatically doing that. I was hoping I could create a form with the
script to spin through the folder and set that.

- Brian
 
S

Sue Mosher [MVP-Outlook]

Read the 2nd paragraph of my last response. That's the property you need to
set.

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
B

Brian

I'm sorry Sue. I must not have read it right the first time. I'll give
that a shot. Thank you for your help.

- Brian
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top