use of If condition in a form RRS feed

  • Question

  • We are considering building a template form in WORD 2010.

    I have managed to create the template by using Userform (VB) to populate many areas of the form. Which works fine.

    Then in the form I have options to select Yes and No (from Drop down menu).

    Now I need some control with this Yes and No.

    Here is the problem:

    Option 1:

    If I select Yes from the Drop down menu then in the next section a portion of text should appear for further selection

    Or if I select No it should prompt me to go another section.

    Otherwise - Option 2 - active or inactive text

    Lets assume I always have the entire documents or text in the file - then if I select Yes one portion of the text should be in active.

    Could you please help me to create such logical document.

    Thanks in advance

    Thursday, March 2, 2017 3:42 AM

All replies

  • Hello,

    Option 1, you may use Selection.GoTo to jump into next section

    Select Case Value
    Case "Yes"
    Selection.GoTo What:=wdGoToSection, Which:=wdGoToNext, Count:=1
    Case "No"
    MsgBox "Please go to another section"
    End Select

    Option 2:  What do you mean "active or inactive"? Do you want to lock these text? I would suggest you use content control to prevent users from editing or deleting.



    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact

    Monday, March 6, 2017 8:56 AM