Outlook Scrtipt Pb. Using Item_PropertyChange(ByVal Name)

N

news.microsoft.com

Hi all,

I try to use a comboBox to set different fields, each time a user select a
value in the combo it's set up others fields

I do it with Item_CustomPropertyChange(ByVal Name) and it works fine


But When I use this it doesn't work at all

Sub Item_PropertyChange(ByVal Name)
Select Case Name
Case "Companies"
If Item.Userproperties("Companies")="McAfee" then
' The instruction here are not executed

End if
End Select
End Sub



I even try with the name of the combobox wich is "Partenaires" an still
not working


Can some on help me



Tks
 
S

Sue Mosher [MVP-Outlook]

What type of form is this?

--
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

It's Customized Task



"Sue Mosher [MVP-Outlook]" <[email protected]> a écrit dans le message
de news: (e-mail address removed)...
What type of form is this?

--
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]

For unexplained reasons, a change to the Companies property doesn't fire a PropertyChange event. A somewhat messy workaround is to create a combination or formula field (name it COmpanyClone) with the formula [Company] and use the CustomPropertyCHange event to monitor that field:

Sub Item_CustomPropertyChange(ByVal Name)
If Name = "CompanyClone" Then
MsgBox Item.Companies
End If
End Sub

What makes it messy is that CustomPropertyChange will fire more than once for that property. Perhaps Companies acts so oddly because it is a keywords 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

It's Customized Task



"Sue Mosher [MVP-Outlook]" <[email protected]> a écrit dans le message
de news: (e-mail address removed)...
What type of form is this?

--
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 all,

I try to use a comboBox to set different fields, each time a user select
a
value in the combo it's set up others fields

I do it with Item_CustomPropertyChange(ByVal Name) and it works fine


But When I use this it doesn't work at all

Sub Item_PropertyChange(ByVal Name)
Select Case Name
Case "Companies"
If Item.Userproperties("Companies")="McAfee" then
' The instruction here are not executed

End if
End Select
End Sub



I even try with the name of the combobox wich is "Partenaires" an
still
not working


Can some on help me



Tks
 
N

news.microsoft.com

Hi Sue,

I didn't understand your solution, did u mean that I must remove the
built-in object (Companies) from my form and replace it with a personal
combo ?

tks

"Sue Mosher [MVP-Outlook]" <[email protected]> a écrit dans le message
de %[email protected]...
For unexplained reasons, a change to the Companies property doesn't fire a
PropertyChange event. A somewhat messy workaround is to create a combination
or formula field (name it COmpanyClone) with the formula [Company] and use
the CustomPropertyCHange event to monitor that field:

Sub Item_CustomPropertyChange(ByVal Name)
If Name = "CompanyClone" Then
MsgBox Item.Companies
End If
End Sub

What makes it messy is that CustomPropertyChange will fire more than once
for that property. Perhaps Companies acts so oddly because it is a keywords
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

It's Customized Task



"Sue Mosher [MVP-Outlook]" <[email protected]> a écrit dans le
message
de news: (e-mail address removed)...
What type of form is this?

--
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 all,

I try to use a comboBox to set different fields, each time a user select
a
value in the combo it's set up others fields

I do it with Item_CustomPropertyChange(ByVal Name) and it works fine


But When I use this it doesn't work at all

Sub Item_PropertyChange(ByVal Name)
Select Case Name
Case "Companies"
If Item.Userproperties("Companies")="McAfee" then
' The instruction here are not executed

End if
End Select
End Sub



I even try with the name of the combobox wich is "Partenaires" an
still
not working


Can some on help me



Tks
 
S

Sue Mosher [MVP-Outlook]

The workaround I offered (and it's not a particularly good one) involves a formula field that doesn't get shown to the user. It's present on the form only to provide you with an event when the user changes the value for Compnies.

--
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 didn't understand your solution, did u mean that I must remove the
built-in object (Companies) from my form and replace it with a personal
combo ?

tks

"Sue Mosher [MVP-Outlook]" <[email protected]> a écrit dans le message
de %[email protected]...
For unexplained reasons, a change to the Companies property doesn't fire a
PropertyChange event. A somewhat messy workaround is to create a combination
or formula field (name it COmpanyClone) with the formula [Company] and use
the CustomPropertyCHange event to monitor that field:

Sub Item_CustomPropertyChange(ByVal Name)
If Name = "CompanyClone" Then
MsgBox Item.Companies
End If
End Sub

What makes it messy is that CustomPropertyChange will fire more than once
for that property. Perhaps Companies acts so oddly because it is a keywords
property.
 

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