Reply
 
Thread Tools Display Modes
  #1   Report Post  
Robert Kleinschmidt
 
Posts: n/a
Default 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   Report Post  
Doug Robbins
 
Posts: n/a
Default

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   Report Post  
Greg Maxey
 
Posts: n/a
Default

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   Report Post  
Greg Maxey
 
Posts: n/a
Default

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   Report Post  
Doug Robbins
 
Posts: n/a
Default

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

Posting Rules

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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
cross reference inserts entire figure digitig Microsoft Word Help 4 October 10th 14 11:56 AM
WORD 2003 Cross Reference Error Cheryl Microsoft Word Help 2 July 11th 05 04:09 PM
SEQ Field not in cross-reference reference type pull-down menu The Josh Microsoft Word Help 5 May 25th 05 02:27 PM
cross reference to a numbered item dimaneel Microsoft Word Help 1 April 4th 05 11:52 PM
Cross reference to custom caption type Ton Microsoft Word Help 2 February 9th 05 04:04 PM


All times are GMT +1. The time now is 11:34 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"