Sue,
You were correct I was not understanding the code correctly but I do have it
working from your instructions. However, I am trying to use the change
property values event but want it to also to occur based on a check box
click even. for example.
If the check box is true when the change property values occurs nothing
happens but once the checkbox is clicked the change properties value then is
initiated. I can't seem to nest the events. What I have below only occurs
after the box is clicked and then I go back and select the drop down box
again. Thanks in advance
ub Item_CustomPropertyChange(ByVal Name)
Set MyPage = Item.GetInspector.ModifiedFormPages("Requisition Form")
Set MyControl = MyPage.Controls("CheckBox14")
If MyControl.Value = True then
Select Case Name
Case "Vendor"
strMyProp1 = Item.UserProperties("Vendor")
Select Case Right(strMyProp1,1)
Case "n"
Set Recipient = Recipients.Add ("Doe, John")
Recipient.Type = 1
Recipients.ResolveAll
End Select
Select Case Right(strMyProp1,1)
Case "g"
Set Recipient = Recipients.Add ("Wilson, greg")
Recipient.Type = 1
Recipients.ResolveAll
End Select
Select Case Right(strMyProp1,1)
Case "r"
Set Recipient = Recipients.Add ("Ross, Mike")
Recipient.Type = 1
Recipients.ResolveAll
End Select
End Select
End If
End Sub
"Sue Mosher [MVP]" wrote:
> Please look again at the sample code on the page I suggested. It shows how
> to run code only on a change to the property you're interested in, not all
> properties.
> Also, if the control is bound, your code should work with the property
> value, not the control value. And I suspect it's bound to a custom property,
> not a standard property, which means you need to use the
> CustomPropertyChange event.
> > Sue Mosher
> > >
> "Clueless" <Clueless> wrote in message
> news57432AB-13C9-4BD3-B70F-BEEEF1C0C81E@microsoft.com...
> > Sue,
> > The control is bound, I used the Item PropertyChange (ByVal name)
> > The following code would put John Doe has the recipent but it kept doing
> > it
> > multiple times until outlook locked up. I want the recipient to be add
> > just
> > once or removed and changed based on the My.Control.Value. in my Combo
> > Box.
> > Sub Item_PropertyChange(ByVal Name)
> > Set MyPage = Item.GetInspector.ModifiedFormPages("Requisition Form")
> > Set MyControl = MyPage.Controls("ComboBox24")
> > If Right(MyControl.Value,1) = "e" Then
> > Set Recipient = Recipients.Add ("Doe, John")
> > Recipient.Type = 1
> > Recipients.ResolveAll
> > End If
> > End Sub
> > What am I missing?
> > Thanks
> > "Sue Mosher [MVP]" wrote:
> >
> >> The event to use depends on whether the control is bound to an Outlook
> >> property. See http://www.outlookcode.com/article.aspx?ID=38
> >
> >> "Clueless" <Clueless> wrote in message
> >> news:BFA946AF-B1F5-4504-AE87-5782C76780D0@microsoft.com...
> >> >I have a custom Outlook 2007 form that I need help with writing code to
> >> > perform the following.
> >> >> > I have two Drop Down boxes: Box 1. person - responsibility Box 2.
> >> > location
> >> > - person
> >> >> > When a certain person is selected in the 1st. Box I want the person's
> >> > name
> >> > to automatically load as a recipient of the email. I would also like to
> >> > be
> >> > able to add an additional name as a recipients to the same email when
> >> > Box
> >> > 2.
> >> > Has a location and person selected. I use the following code to fill in
> >> > a
> >> > recipient based on a click event but I am not sure how to do an event
> >> > based
> >> > on the value in a drop down box
> >> >> > Sub CommandButton2_Click()
> >> > Recipients.Add "Doe, John"
> >> > Recipients.ResolveAll
> >> > Recipients.Add "Smith, Bill"
> >> > Recipients.ResolveAll
> >> > End Sub
>