Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.docmanagement
Benjamin Benjamin is offline
external usenet poster
 
Posts: 4
Default "Conditional formatting" in Word drop-down form fields

Word 2000, Windows XP.

Hi,

I'm working with drop-down form fields placed in word table cells. Each
drop-down formfield has the selections red, yellow and green. I'm looking for
the code to the on exit macro so that the color of the cell turn red if red
is selected and so on...after the selection it should go to the next form
field.

The document should unprotect, format the cell, then protect again without
resetting and jump to the next form field.

Thanks in advance...
  #2   Report Post  
Posted to microsoft.public.word.docmanagement
Cindy M. Cindy M. is offline
external usenet poster
 
Posts: 2,416
Default "Conditional formatting" in Word drop-down form fields

Hi ?B?QmVuamFtaW4=?=,

I'm working with drop-down form fields placed in word table cells. Each
drop-down formfield has the selections red, yellow and green. I'm looking for
the code to the on exit macro so that the color of the cell turn red if red
is selected and so on...after the selection it should go to the next form
field.

The document should unprotect, format the cell, then protect again without
resetting and jump to the next form field.

Yes. Have you tried recording these actions in a macro? Do so, copy the result
into a reply, and explain what part doesn't work. (We can then show you how to
make the color selection.)

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :-)

  #3   Report Post  
Posted to microsoft.public.word.docmanagement
Benjamin Benjamin is offline
external usenet poster
 
Posts: 4
Default "Conditional formatting" in Word drop-down form fields

I'm not sure how to record a macro when the form protection has been activated.

The macro I've been trying (see below) seems to be working when I tab
through the cells, but if I jump to new form fields using the mouse, Word
crashes at a point:

Sub ColorField()

ProtectDoc 'macro to protect and unprotect

Selection.SelectCell
DropdownName = Selection.FormFields(1).Name

If ActiveDocument.FormFields(DropdownName).Result = "Red" Then
With Selection.Cells
With .Shading
.BackgroundPatternColor = wdColorRed
End With
End With
ElseIf ActiveDocument.FormFields(DropdownName).Result = "Yellow" Then
..
..
..
..
End If

ProtectDoc

ActiveDocument.FormFields(DropdownName).Select

End Sub



Sub ProtectDoc()

If ActiveDocument.ProtectionType = wdNoProtection Then
ActiveDocument.Protect _
Type:=wdAllowOnlyFormFields, NoReset:=True
Else
ActiveDocument.Unprotect
End If

End Sub


"Cindy M." wrote:

Hi ?B?QmVuamFtaW4=?=,

I'm working with drop-down form fields placed in word table cells. Each
drop-down formfield has the selections red, yellow and green. I'm looking for
the code to the on exit macro so that the color of the cell turn red if red
is selected and so on...after the selection it should go to the next form
field.

The document should unprotect, format the cell, then protect again without
resetting and jump to the next form field.

Yes. Have you tried recording these actions in a macro? Do so, copy the result
into a reply, and explain what part doesn't work. (We can then show you how to
make the color selection.)

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :-)


Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Why dont MS just f**king re-write Word from scratch? Its dogsh*t Word Hater Microsoft Word Help 33 May 5th 23 02:52 PM
Drop Down Menus Items Displaying Specific Content trailerparkboy Microsoft Word Help 11 October 3rd 07 03:09 AM
Change paper size; Word changes to invalid margins OhioTech New Users 10 July 6th 06 02:00 PM
WP merge file to Word sstires Tables 4 February 14th 06 06:26 PM
In Word, how can I see all files (*.*) in "save as"? citizen53 New Users 8 April 4th 05 04:56 PM


All times are GMT +1. The time now is 04:30 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"