+ Reply to Thread
Results 1 to 14 of 14

Is Conditional formatting possible for dropdown list in word ?

  1. #1
    Registered User
    Join Date
    08-23-2012
    Location
    us
    MS-Off Ver
    Excel 2003
    Posts
    17

    Is Conditional formatting possible for dropdown list in word ?

    Hi,

    I am desiging a MS word form using the legacy tool feature. My problem is as follows;
    I'm trying to incorporate conditional formatting similar to what we can do in excel.Threre is a drop down form field with three choices , let say Red,Green and yellow. When these choices are slected i want the background to change/shaded appropritely. i.e. color red when the user selection is "red" from the dropdown and so on.
    So far i have seen only VBA codes to change the fonts only but not the one to change the background color.

    So is this possible to change the background color ?

    below is the code for to change the font color,but it is not refreshing ...
    Please Login or Register  to view this content.
    any help appreciated.

    Thanks,

  2. #2
    Forum Expert macropod's Avatar
    Join Date
    12-22-2011
    Location
    Canberra, Australia
    MS-Off Ver
    Word, Excel & Powerpoint 2003 & 2010
    Posts
    3,726

    Re: Is Conditional formatting possible for dropdown list in word ?

    Hi wmurgan,

    Have you attached the macro to the calling formfield's 'on exit' property?
    Does the dropdown have an internal bookmark named "Dropdown2" (which is what the code refers to)?
    Are you exiting the dropdown?
    Assuming the answer to all three questions is yes, you could use:
    Please Login or Register  to view this content.
    Cheers,
    Paul Edstein
    [Fmr MS MVP - Word]

  3. #3
    Registered User
    Join Date
    08-23-2012
    Location
    us
    MS-Off Ver
    Excel 2003
    Posts
    17

    Re: Is Conditional formatting possible for dropdown list in word ?

    Hi Paul,

    Thanks for your quick help.I wasn't sure if the shading option was available.Great tip!.
    For some reason it's not working properley for me. Please see the attached doc.What i am doing wrong here? Ideally i would want the shading including the font color to change per the user input from the dropdown without having to save the file and re-open to see the change. Hopefully this makes sense.Appreciate the help once again.

    Regards,
    Wmurugan
    Attached Files Attached Files

  4. #4
    Forum Expert macropod's Avatar
    Join Date
    12-22-2011
    Location
    Canberra, Australia
    MS-Off Ver
    Word, Excel & Powerpoint 2003 & 2010
    Posts
    3,726

    Re: Is Conditional formatting possible for dropdown list in word ?

    Hi Wmurugan,

    It works fine for me. You need to apply forms protection and, preferably, turn off formfield shading (via the legacy tools button on the Developer tab).

    PS: For whatever reason you've formatted the formfield as bright green. If you're going to be changing the background shading, I'd suggest changing the font colours at the same time, to provide more contrast.

  5. #5
    Registered User
    Join Date
    08-23-2012
    Location
    us
    MS-Off Ver
    Excel 2003
    Posts
    17

    Re: Is Conditional formatting possible for dropdown list in word ?

    Hi Paul,

    Thanks once again. Yes the shading works with the click of "Tab".The other problem that i am trying to solve is - the dropdown input letter font color to match the background/shading color. Since those letters are for user input only. So for red shading the letter"r" font color should also be red and so on for the rest of the selection letters.

    Apart from that can you check the attached doc. and let me know why i'm not able to replicate the shading in multiple dropdown list.

    Appreciate your help.

    Regards,
    Wmurugan
    Attached Files Attached Files

  6. #6
    Forum Expert macropod's Avatar
    Join Date
    12-22-2011
    Location
    Canberra, Australia
    MS-Off Ver
    Word, Excel & Powerpoint 2003 & 2010
    Posts
    3,726

    Re: Is Conditional formatting possible for dropdown list in word ?

    See attached.
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    08-23-2012
    Location
    us
    MS-Off Ver
    Excel 2003
    Posts
    17

    Re: Is Conditional formatting possible for dropdown list in word ?

    Hi Paul,

    Thanks a lot. It works fine in your attached document. Did you change any object property to remove the grey font background. See the attached document. I'm unable to replicate the same in my document. Also i'm getting the "runtime error 5941" the requested member of the collection doesn't exist. I have another legacy dropdown field which is simple dropdown list without any color format, for which i removed the bookmark and there is no macro attached to it.
    So basically, 1) What object properties do i need to change to remove the grey background (see the attached doc.)
    2) how to handle the runtime error 5941.

    Appreciate the help.

    Regards,
    wmurugan
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    08-23-2012
    Location
    us
    MS-Off Ver
    Excel 2003
    Posts
    17

    Re: Is Conditional formatting possible for dropdown list in word ?

    Hi Paul,

    I found that the solution to my first question wrt grey background. All i need to do was to trun off the "Form field" shading in the legacy tool. Now i'm not sure how to handle the error code.

    Thanks

  9. #9
    Forum Expert macropod's Avatar
    Join Date
    12-22-2011
    Location
    Canberra, Australia
    MS-Off Ver
    Word, Excel & Powerpoint 2003 & 2010
    Posts
    3,726

    Re: Is Conditional formatting possible for dropdown list in word ?

    Try changing the Document_Open sub to:
    Please Login or Register  to view this content.

  10. #10
    Registered User
    Join Date
    08-23-2012
    Location
    us
    MS-Off Ver
    Excel 2003
    Posts
    17

    Re: Is Conditional formatting possible for dropdown list in word ?

    Hi,

    Not sure what is wrong. Getting the same Runtime error 5941 'The requested member of the collection doesn't exist'.

    Attached is the snapshot of the code when i try to debug. Thanks for your continued help.

    Regards,
    Wmurugan
    Attached Images Attached Images

  11. #11
    Forum Expert macropod's Avatar
    Join Date
    12-22-2011
    Location
    Canberra, Australia
    MS-Off Ver
    Word, Excel & Powerpoint 2003 & 2010
    Posts
    3,726

    Re: Is Conditional formatting possible for dropdown list in word ?

    Hmm, I'm not getting an error with either of the two previous implementations. Give this a try:
    Please Login or Register  to view this content.

  12. #12
    Registered User
    Join Date
    08-23-2012
    Location
    us
    MS-Off Ver
    Excel 2003
    Posts
    17

    Re: Is Conditional formatting possible for dropdown list in word ?

    Hi Paul,

    Thanks a lot. It now seems to have fixed the runtime error 5941. But apparently there is new runtime error 4248-" This command is not availble becuse no document is open". This happens when the new user tries to open the word document after clicking the enabling editing in the protected view. Is there way to handle this with error handler similar to this;

    Please Login or Register  to view this content.
    apprecite your help greatly.

    Regards,

  13. #13
    Registered User
    Join Date
    08-23-2012
    Location
    us
    MS-Off Ver
    Excel 2003
    Posts
    17

    Re: Is Conditional formatting possible for dropdown list in word ?

    Hi Paul,

    I fixed the problem with the following code below;

    Please Login or Register  to view this content.
    Thanks a bunch for answering my repeated questions. Appreciate all your help.

    Regards,
    wmurugan

  14. #14
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: Is Conditional formatting possible for dropdown list in word ?

    @ wmurugan

    Based on your last post it seems that you are satisfied with the solution(s) you've received but you haven't marked your thread as SOLVED. I'll do that for you now but please keep in mind for your future threads that Rule #9 requires you to do that yourself. If your problem has not been solved you can use Thread Tools (located above your first post) and choose "Mark this thread as unsolved".
    Thanks.

    Also, as a new member of the forum, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1