Outlook 2003 Script How to put a value in ContactName

  • Thread starter news.microsoft.com
  • Start date
N

news.microsoft.com

Hi all,
I made un custom task Form, I added a combo whith companies, I want to
automatically fill the fild ContactNames with a specific Name based on the
choice of the companies

I've not found the way to fill the contactNames

I tried the name of the text box "_RecipientControl1"
and the StatusUpdateRecipients StatusOncompletionRecipients

but no one work's

Someone can help plz
 
S

Sue Mosher [MVP-Outlook]

I'm not clear on just what you're trying to do. ContactNames is a string property, so you assign its value simply as:

Item.ContactNames = "name1, name 2"

Are you thinking instead of the Contacts box at the bottom of the task form? That exposes the Links collection, which uses this syntax:

Item.Links.Add theContactItem

where theContactItem is an Outlook contact. In other words, you'd need to create (or return) a contact first, before you can add it as a linked contact to the Links collection.
--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
N

news.microsoft.com

Hi Sue,

I used ContactNames before and it work at 50% (Item.ContactNames )

The Pb is when I set a value to the contactnames by a script it doesn't
display the my value in the contact text box,

but if a save this task and reopen it at this time myvalue is displayed in
the ContactNames text box


tks for help


"Sue Mosher [MVP-Outlook]" <[email protected]> a écrit dans le message
de news: (e-mail address removed)...
I'm not clear on just what you're trying to do. ContactNames is a string
property, so you assign its value simply as:

Item.ContactNames = "name1, name 2"

Are you thinking instead of the Contacts box at the bottom of the task form?
That exposes the Links collection, which uses this syntax:

Item.Links.Add theContactItem

where theContactItem is an Outlook contact. In other words, you'd need to
create (or return) a contact first, before you can add it as a linked
contact to the Links collection.
--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
S

Sue Mosher [MVP-Outlook]

I'm not sure what "contact text box" you're referring to. The Contacts box on the main page (not a text box, but a recipients control) is associated with the Links collection, not the ContactNames property.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers


news.microsoft.com said:
Hi Sue,

I used ContactNames before and it work at 50% (Item.ContactNames )

The Pb is when I set a value to the contactnames by a script it doesn't
display the my value in the contact text box,

but if a save this task and reopen it at this time myvalue is displayed in
the ContactNames text box


tks for help


"Sue Mosher [MVP-Outlook]" <[email protected]> a écrit dans le message
de news: (e-mail address removed)...
I'm not clear on just what you're trying to do. ContactNames is a string
property, so you assign its value simply as:

Item.ContactNames = "name1, name 2"

Are you thinking instead of the Contacts box at the bottom of the task form?
That exposes the Links collection, which uses this syntax:

Item.Links.Add theContactItem

where theContactItem is an Outlook contact. In other words, you'd need to
create (or return) a contact first, before you can add it as a linked
contact to the Links collection.

news.microsoft.com said:
Hi all,
I made un custom task Form, I added a combo whith companies, I want to
automatically fill the fild ContactNames with a specific Name based on
the
choice of the companies

I've not found the way to fill the contactNames

I tried the name of the text box "_RecipientControl1"
and the StatusUpdateRecipients StatusOncompletionRecipients

but no one work's

Someone can help plz
 
B

bbnimda

Is there a way to put a value (exp: (e-mail address removed)), when
compagnyABC is selected (by combo) in the compagnies property ?

tks


"Sue Mosher [MVP-Outlook]" <[email protected]> a écrit dans le message
de %23%[email protected]...
I'm not sure what "contact text box" you're referring to. The Contacts box
on the main page (not a text box, but a recipients control) is associated
with the Links collection, not the ContactNames property.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers


news.microsoft.com said:
Hi Sue,

I used ContactNames before and it work at 50% (Item.ContactNames )

The Pb is when I set a value to the contactnames by a script it doesn't
display the my value in the contact text box,

but if a save this task and reopen it at this time myvalue is displayed in
the ContactNames text box


tks for help


"Sue Mosher [MVP-Outlook]" <[email protected]> a écrit dans le
message
de news: (e-mail address removed)...
I'm not clear on just what you're trying to do. ContactNames is a string
property, so you assign its value simply as:

Item.ContactNames = "name1, name 2"

Are you thinking instead of the Contacts box at the bottom of the task
form?
That exposes the Links collection, which uses this syntax:

Item.Links.Add theContactItem

where theContactItem is an Outlook contact. In other words, you'd need to
create (or return) a contact first, before you can add it as a linked
contact to the Links collection.

news.microsoft.com said:
Hi all,
I made un custom task Form, I added a combo whith companies, I want to
automatically fill the fild ContactNames with a specific Name based on
the
choice of the companies

I've not found the way to fill the contactNames

I tried the name of the text box "_RecipientControl1"
and the StatusUpdateRecipients StatusOncompletionRecipients

but no one work's

Someone can help plz
 
S

Sue Mosher [MVP-Outlook]

Probably, but the details will depend on exactly what you mean by "put a value ... when ... selected (by combo) ... " etc. See http://www.outlookcode.com/d/propsyntax.htm

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers


bbnimda said:
Is there a way to put a value (exp: (e-mail address removed)), when
compagnyABC is selected (by combo) in the compagnies property ?

tks


"Sue Mosher [MVP-Outlook]" <[email protected]> a écrit dans le message
de %23%[email protected]...
I'm not sure what "contact text box" you're referring to. The Contacts box
on the main page (not a text box, but a recipients control) is associated
with the Links collection, not the ContactNames property.

news.microsoft.com said:
Hi Sue,

I used ContactNames before and it work at 50% (Item.ContactNames )

The Pb is when I set a value to the contactnames by a script it doesn't
display the my value in the contact text box,

but if a save this task and reopen it at this time myvalue is displayed in
the ContactNames text box


tks for help


"Sue Mosher [MVP-Outlook]" <[email protected]> a écrit dans le
message
de news: (e-mail address removed)...
I'm not clear on just what you're trying to do. ContactNames is a string
property, so you assign its value simply as:

Item.ContactNames = "name1, name 2"

Are you thinking instead of the Contacts box at the bottom of the task
form?
That exposes the Links collection, which uses this syntax:

Item.Links.Add theContactItem

where theContactItem is an Outlook contact. In other words, you'd need to
create (or return) a contact first, before you can add it as a linked
contact to the Links collection.

news.microsoft.com said:
Hi all,
I made un custom task Form, I added a combo whith companies, I want to
automatically fill the fild ContactNames with a specific Name based on
the
choice of the companies

I've not found the way to fill the contactNames

I tried the name of the text box "_RecipientControl1"
and the StatusUpdateRecipients StatusOncompletionRecipients

but no one work's

Someone can help plz
 
B

bbnimda

My Pb is to " display " the value

When I do this

Item.ContactNames = " (e-mail address removed)" nothing is displayed in Contacts
"text box"

if I save and quit and reopen the task (e-mail address removed) is now displayed in
contacts how can I display imediatly " (e-mail address removed) " in contacts
(textbox) by code ( if companies = "ABC" then contactnames ="
(e-mail address removed) ") this code set the value of contactNames to (e-mail address removed) but
nothing is visible on the form

I hope I've been as clear as possible

tks



"Sue Mosher [MVP-Outlook]" <[email protected]> a écrit dans le message
de %[email protected]...
Probably, but the details will depend on exactly what you mean by "put a
value ... when ... selected (by combo) ... " etc. See
http://www.outlookcode.com/d/propsyntax.htm

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers


bbnimda said:
Is there a way to put a value (exp: (e-mail address removed)), when
compagnyABC is selected (by combo) in the compagnies property ?

tks


"Sue Mosher [MVP-Outlook]" <[email protected]> a écrit dans le
message
de %23%[email protected]...
I'm not sure what "contact text box" you're referring to. The Contacts box
on the main page (not a text box, but a recipients control) is associated
with the Links collection, not the ContactNames property.

news.microsoft.com said:
Hi Sue,

I used ContactNames before and it work at 50% (Item.ContactNames )

The Pb is when I set a value to the contactnames by a script it doesn't
display the my value in the contact text box,

but if a save this task and reopen it at this time myvalue is displayed
in
the ContactNames text box


tks for help


"Sue Mosher [MVP-Outlook]" <[email protected]> a écrit dans le
message
de news: (e-mail address removed)...
I'm not clear on just what you're trying to do. ContactNames is a string
property, so you assign its value simply as:

Item.ContactNames = "name1, name 2"

Are you thinking instead of the Contacts box at the bottom of the task
form?
That exposes the Links collection, which uses this syntax:

Item.Links.Add theContactItem

where theContactItem is an Outlook contact. In other words, you'd need to
create (or return) a contact first, before you can add it as a linked
contact to the Links collection.

news.microsoft.com said:
Hi all,
I made un custom task Form, I added a combo whith companies, I want to
automatically fill the fild ContactNames with a specific Name based on
the
choice of the companies

I've not found the way to fill the contactNames

I tried the name of the text box "_RecipientControl1"
and the StatusUpdateRecipients StatusOncompletionRecipients

but no one work's

Someone can help plz
 
S

Sue Mosher [MVP-Outlook]

You would need to use the TaskItem.Links technique that I already described.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers


bbnimda said:
My Pb is to " display " the value

When I do this

Item.ContactNames = " (e-mail address removed)" nothing is displayed in Contacts
"text box"

if I save and quit and reopen the task (e-mail address removed) is now displayed in
contacts how can I display imediatly " (e-mail address removed) " in contacts
(textbox) by code ( if companies = "ABC" then contactnames ="
(e-mail address removed) ") this code set the value of contactNames to (e-mail address removed) but
nothing is visible on the form

I hope I've been as clear as possible

tks



"Sue Mosher [MVP-Outlook]" <[email protected]> a écrit dans le message
de %[email protected]...
Probably, but the details will depend on exactly what you mean by "put a
value ... when ... selected (by combo) ... " etc. See
http://www.outlookcode.com/d/propsyntax.htm
bbnimda said:
Is there a way to put a value (exp: (e-mail address removed)), when
compagnyABC is selected (by combo) in the compagnies property ?

tks


"Sue Mosher [MVP-Outlook]" <[email protected]> a écrit dans le
message
de %23%[email protected]...
I'm not sure what "contact text box" you're referring to. The Contacts box
on the main page (not a text box, but a recipients control) is associated
with the Links collection, not the ContactNames property.

news.microsoft.com said:
Hi Sue,

I used ContactNames before and it work at 50% (Item.ContactNames )

The Pb is when I set a value to the contactnames by a script it doesn't
display the my value in the contact text box,

but if a save this task and reopen it at this time myvalue is displayed
in
the ContactNames text box


tks for help


"Sue Mosher [MVP-Outlook]" <[email protected]> a écrit dans le
message
de news: (e-mail address removed)...
I'm not clear on just what you're trying to do. ContactNames is a string
property, so you assign its value simply as:

Item.ContactNames = "name1, name 2"

Are you thinking instead of the Contacts box at the bottom of the task
form?
That exposes the Links collection, which uses this syntax:

Item.Links.Add theContactItem

where theContactItem is an Outlook contact. In other words, you'd need to
create (or return) a contact first, before you can add it as a linked
contact to the Links collection.

Hi all,
I made un custom task Form, I added a combo whith companies, I want to
automatically fill the fild ContactNames with a specific Name based on
the
choice of the companies

I've not found the way to fill the contactNames

I tried the name of the text box "_RecipientControl1"
and the StatusUpdateRecipients StatusOncompletionRecipients

but no one work's

Someone can help plz
 

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