Results 1 to 2 of 2
  1. #1
    2 Star Lounger
    Join Date
    Jan 2003
    Renfrewshire, Scotland
    Thanked 0 Times in 0 Posts

    Custom Outlook Form - CustomPropertyChange (Outlook 2000)

    Hi there,

    I'm trying to create a custom Outlook form that will throw up a message box when the user chooses one option from a drop down list. I have tried the suggested method (from of using a case statement, but can't get it to work at all...I have also tried doing a Conditional statement - and this works to some degree...I get the correct message boxes when I change the custom property - but if I change any of the custom properties on the same page I get one of the
    message boxes displaying again!

    I've tried referring to the custom property using the field name and also using the name of the combobox - but neither works.

    I have been playing around with a wee test form with two combo boxes - here's the code I've been trying:

    'Sub Item_CustomPropertyChange(ByVal cb1)

    'Set MyPage=Item.GetInspector.ModifiedFormPages("Messag e")
    'fieldchange = MyPage.cb1.Value

    'If fieldchange = "No" then
    ' MsgBox "No sir I don't think so"
    ' MsgBox "Yup yup yup"

    'End if
    'End Sub

    Sub Item_CustomPropertyChange(ByVal fieldselect)

    Set MyPage=Item.GetInspector.ModifiedFormPages("Messag e")
    fieldchange = MyPage.fieldselect.Value

    Select case fieldselect
    Case "No"
    MsgBox "No sir I don't think so"
    Case "Yes"
    MsgBox "Yup yup yup"
    End Select

    End Sub

    The combobox I want to monitor's name is "cb1", and its field name is "fieldselect" - so you can see that I have tried both.....anyone with any ideas will be onto a penny



  2. #2
    5 Star Lounger
    Join Date
    May 2001
    Washington, USA
    Thanked 0 Times in 0 Posts

    Re: Custom Outlook Form - CustomPropertyChange (Outlook 2000)

    That's the way PropertyChange and CustomPropertyChange work. You want to go for the Click event of the control if you want to limit what OL responds to. Maybe something like this:

    Sub cb1_Click()
    'Set MyPage=Item.GetInspector.ModifiedFormPages("Messag e")
    ' Set fieldchange = MyPage.Controls("cb1")
    ' fieldchangeValue = cb1.value

    'If fieldchangeValue = "No" then
    ' MsgBox "No way, what have you been smok'n"
    ' MsgBox "Yah, sure - you betch'a"

    'End if
    'End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts