M
Michele
I am trying to find a way to add to the Links collection of a contact,
through vba code, two links with the same "Subject" property and I can't find
another way than the one that I will further explain.
I make a detailed example to make you well understand my problem.
I have three contacts in my Default contacts folder. Contact number 2 and
Contact number 3 have these exact properties: ContactNumber2.Title="Dr.",
ContactNumber2.FirstName="John",
ContactNumber2.MiddleName="Paul", ContactNumber2.LastName="Carter",
ContactNumber2.Suffix="Jr."; ContactNumber3.Title="Dr.",
ContactNumber3.FirstName="John",
ContactNumber3.MiddleName="Paul", ContactNumber3.LastName="Carter",
ContactNumber3.Suffix="Jr.".
The "Subject" property of a contact is always ( no matter what options you
have in the general Outlook options ) automatically filled by Outlook in this
way:
ContactItem.FirstName & " " & ContactItem.MiddleName & " " &
ContactItem.LastName & " " & ContactItem.Suffix. ( So without the Title field
)
So in my case the "Subject" property of Contact number 2 and Contact number
3 are exactly the same.
I am talking about the "Subject" property because I found that when you add
a Link to the Links collection of a contact, the added Link "Name" property
is the same as the "Subject" property of the contact.
I found also that you can't add through vba code ( and also through the
standard way to achieve that in Outlook UI ) two links with the same "Name"
property to the same collection because when you try to do that (
And in VBA you can do that only using the Links.add method that accepts as
its argument only a single object of type OlContact, so you can't input as
its argument a collection of Contacts ) Outlook simply
overrides the link that has the same "Name" property with the last one that
you added.
So the only way I found to add through code the Contact number 2 and the
Contact number 3 to the Contact number 1 links collection is to modify the
"Subject" property of Contact number 2 and Contact number 3
so that they are not anymore equal and that is working.
My worry is that I wish not to modify the "Subject" property of a contact
because it is used internally many times by Outlook, in fact as you can see
with the PropertyChangeEvent of a contact inspector
Outlook updates the "Subject" property of a contact many times when you
change (almost) any kind of properties of the contact so that means it needs
that field to be updated and equal to the construction I
made above. For example the "Subject" field is updated and used to construct
the "Display as" field of a new email address that is entered for the
contact. ( But there are many other uses of it )
Do u know any other method to add, through code, two contacts with the same
"Subject" property to a third contact links collection not modifying the
"Subject" standard property?
Thanks a lot for reading me and for any suggestion.
Ciao
through vba code, two links with the same "Subject" property and I can't find
another way than the one that I will further explain.
I make a detailed example to make you well understand my problem.
I have three contacts in my Default contacts folder. Contact number 2 and
Contact number 3 have these exact properties: ContactNumber2.Title="Dr.",
ContactNumber2.FirstName="John",
ContactNumber2.MiddleName="Paul", ContactNumber2.LastName="Carter",
ContactNumber2.Suffix="Jr."; ContactNumber3.Title="Dr.",
ContactNumber3.FirstName="John",
ContactNumber3.MiddleName="Paul", ContactNumber3.LastName="Carter",
ContactNumber3.Suffix="Jr.".
The "Subject" property of a contact is always ( no matter what options you
have in the general Outlook options ) automatically filled by Outlook in this
way:
ContactItem.FirstName & " " & ContactItem.MiddleName & " " &
ContactItem.LastName & " " & ContactItem.Suffix. ( So without the Title field
)
So in my case the "Subject" property of Contact number 2 and Contact number
3 are exactly the same.
I am talking about the "Subject" property because I found that when you add
a Link to the Links collection of a contact, the added Link "Name" property
is the same as the "Subject" property of the contact.
I found also that you can't add through vba code ( and also through the
standard way to achieve that in Outlook UI ) two links with the same "Name"
property to the same collection because when you try to do that (
And in VBA you can do that only using the Links.add method that accepts as
its argument only a single object of type OlContact, so you can't input as
its argument a collection of Contacts ) Outlook simply
overrides the link that has the same "Name" property with the last one that
you added.
So the only way I found to add through code the Contact number 2 and the
Contact number 3 to the Contact number 1 links collection is to modify the
"Subject" property of Contact number 2 and Contact number 3
so that they are not anymore equal and that is working.
My worry is that I wish not to modify the "Subject" property of a contact
because it is used internally many times by Outlook, in fact as you can see
with the PropertyChangeEvent of a contact inspector
Outlook updates the "Subject" property of a contact many times when you
change (almost) any kind of properties of the contact so that means it needs
that field to be updated and equal to the construction I
made above. For example the "Subject" field is updated and used to construct
the "Display as" field of a new email address that is entered for the
contact. ( But there are many other uses of it )
Do u know any other method to add, through code, two contacts with the same
"Subject" property to a third contact links collection not modifying the
"Subject" standard property?
Thanks a lot for reading me and for any suggestion.
Ciao