Home |
Search |
Today's Posts |
#1
|
|||
|
|||
How does one reference the VALUE of a FORMCHECKBOX bookmark?
I want to use the Checked or Unchecked state of a FORMCHECKBOX to control the
display of text in a template. I can do this using a FORMTEXT or FORMDROPDOWN field with a bookmark and "Calculate on exit" selected. With either FORMTEXT or FORMDROPDOWN I can write { IF {bookmark} = "X" text1 text2 } and it works fine, but how do I do this with FORMCHECKBOX? |
#2
|
|||
|
|||
ActiveDocument.FormFields("Bookmarkname").CheckBox .Value
-- Hope this helps. Please reply to the newsgroup unless you wish to avail yourself of my services on a paid consulting basis. Doug Robbins - Word MVP "Robert Kleinschmidt" Robert wrote in message ... I want to use the Checked or Unchecked state of a FORMCHECKBOX to control the display of text in a template. I can do this using a FORMTEXT or FORMDROPDOWN field with a bookmark and "Calculate on exit" selected. With either FORMTEXT or FORMDROPDOWN I can write { IF {bookmark} = "X" text1 text2 } and it works fine, but how do I do this with FORMCHECKBOX? |
#3
|
|||
|
|||
Robert,
I won't swear to it, but I don't think you can without a bit of VBA. If you use a DocVariable field instead of the if field for your conditional text, have the check box "calculate on exit, and run a macro on exit from the checkbox similar to the following example you should be set: Sub CheckStat() If ActiveDocument.FormFields("Check1").Result = True Then ActiveDocument.Variables("Checkstat").Value = "Checked" Else ActiveDocument.Variables("Checkstat").Value = "Unchecked" End If End Sub In place of the IF field use this field: { DOCVARIABLE "CheckStat" } Variable name, macro name and bookmark names are of course up to you. HTH -- Greg Maxey/Word MVP See: http://gregmaxey.mvps.org/word_tips.htm For some helpful tips using Word. Robert Kleinschmidt wrote: I want to use the Checked or Unchecked state of a FORMCHECKBOX to control the display of text in a template. I can do this using a FORMTEXT or FORMDROPDOWN field with a bookmark and "Calculate on exit" selected. With either FORMTEXT or FORMDROPDOWN I can write { IF {bookmark} = "X" text1 text2 } and it works fine, but how do I do this with FORMCHECKBOX? |
#4
|
|||
|
|||
Doug,
What is the difference between: ActiveDocument.FormFields("Bookmarkname").CheckBox .Value and: ActiveDocument.FormFields("Check1").Result Thanks -- Greg Maxey/Word MVP See: http://gregmaxey.mvps.org/word_tips.htm For some helpful tips using Word. Doug Robbins wrote: ActiveDocument.FormFields("Bookmarkname").CheckBox .Value Doug Robbins - Word MVP "Robert Kleinschmidt" Robert wrote in message ... I want to use the Checked or Unchecked state of a FORMCHECKBOX to control the display of text in a template. I can do this using a FORMTEXT or FORMDROPDOWN field with a bookmark and "Calculate on exit" selected. With either FORMTEXT or FORMDROPDOWN I can write { IF {bookmark} = "X" text1 text2 } and it works fine, but how do I do this with FORMCHECKBOX? |
#5
|
|||
|
|||
Hi Greg,
The former returns either True or False and the latter returns 1 or 0. -- Hope this helps. Please reply to the newsgroup unless you wish to avail yourself of my services on a paid consulting basis. Doug Robbins - Word MVP "Greg Maxey" wrote in message ... Doug, What is the difference between: ActiveDocument.FormFields("Bookmarkname").CheckBox .Value and: ActiveDocument.FormFields("Check1").Result Thanks -- Greg Maxey/Word MVP See: http://gregmaxey.mvps.org/word_tips.htm For some helpful tips using Word. Doug Robbins wrote: ActiveDocument.FormFields("Bookmarkname").CheckBox .Value Doug Robbins - Word MVP "Robert Kleinschmidt" Robert wrote in message ... I want to use the Checked or Unchecked state of a FORMCHECKBOX to control the display of text in a template. I can do this using a FORMTEXT or FORMDROPDOWN field with a bookmark and "Calculate on exit" selected. With either FORMTEXT or FORMDROPDOWN I can write { IF {bookmark} = "X" text1 text2 } and it works fine, but how do I do this with FORMCHECKBOX? |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
cross reference inserts entire figure | Microsoft Word Help | |||
WORD 2003 Cross Reference Error | Microsoft Word Help | |||
SEQ Field not in cross-reference reference type pull-down menu | Microsoft Word Help | |||
cross reference to a numbered item | Microsoft Word Help | |||
Cross reference to custom caption type | Microsoft Word Help |