Results 1 to 2 of 2

Thread: vbs & enable

  1. #1
    ckgoat
    Guest

    vbs & enable

    I'm just learning some vbs code and I stuck. On a custom Outlook contact form, I have a check box that I want to enable / disable a text box filed.

    If Item.UserProperties("WelcomeLetterSent").Value = "False" then
    Item.UserProperties("WelcomeSentDate").enable = False
    end if
    But I get a "not supported error". What's going wrong? How do I enable / disable the text box in the vbs ?

    Thanks,
    Chris

  2. #2
    preed
    Guest

    Re: vbs & enable

    I use CASE statements when I do this type of thing.

    i.e.:
    Set objGeneralPage = Item.GetInspector.ModifiedFormPages("Name of your page on the form")

    'Set objGeneralControl as the target control whose
    'value will affect the properties of other controls
    Set objGeneralControl = objGeneralPage.Controls("WelcomeLetterSent")

    'Set objGeneralAffectedControlx as the control(s)
    'affected by the value of objGeneralControl
    Set objGeneralAffectedControl = objGeneralPage.Controls("WelcomeSentDate")

    'Perform actions to set the enabled and background
    'properties for the affected controls based on the
    'value of objGeneralControl
    Select Case objGeneralControl.Value
    Case "True"
    objGeneralAffectedControl.Enabled = True
    objGeneralAffectedControl.BackColor = vbWhite 'intrinsic cmd for white

    Case "False"
    objGeneralAffectedControl.Enabled = False
    objGeneralAffectedControl.BackColor = 12632256 'gray

    End Select

Posting Permissions

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