Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.docmanagement
Jeff Parker Jeff Parker is offline
external usenet poster
 
Posts: 2
Default Displaying the label of the selected Option Button

Hi, in Word 2003, how can I display elesewhere in the doc the label
associated with the radio/option button that the user has selected? Has this
something to do with Fields? I can't seem to work out how to do it. Any
thoughts please?
  #2   Report Post  
Posted to microsoft.public.word.docmanagement
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default Displaying the label of the selected Option Button

Can I suggest that you don't use activex controls in a document. They are
primarily intended for web page creation. Use instead check boxes - which
can emulate the action of radio buttons with the aid of macros. -
http://word.mvps.org/faqs/tblsfldsfm...FmFldChbxs.htm

However to answer the question asked, radio buttons work in groups. In the
case of two radio buttons with default names you can display that name with
a docvariable field - here {Docvariable varBtn} - and you can set the value
of that variable by using the macro code associated with the option button
eg

Option Explicit
Private oVars As Variables
Private Sub OptionButton1_Click()
Set oVars = ActiveDocument.Variables
If OptionButton1.Value = True Then
oVars("varBtn").Value = "OptionButton1 selected"
End If
ActiveDocument.Fields.Update
End Sub
Private Sub OptionButton2_Click()
Set oVars = ActiveDocument.Variables
If OptionButton2.Value = True Then
oVars("varBtn").Value = "OptionButton2 selected"
End If
ActiveDocument.Fields.Update
End Sub


--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



"Jeff Parker" wrote in message
...
Hi, in Word 2003, how can I display elesewhere in the doc the label
associated with the radio/option button that the user has selected? Has
this
something to do with Fields? I can't seem to work out how to do it. Any
thoughts please?



  #3   Report Post  
Posted to microsoft.public.word.docmanagement
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default Displaying the label of the selected Option Button

Can I suggest that you don't use activex controls in a document. They are
primarily intended for web page creation. Use instead check boxes - which
can emulate the action of radio buttons with the aid of macros. -
http://word.mvps.org/faqs/tblsfldsfm...FmFldChbxs.htm

However to answer the question asked, radio buttons work in groups. In the
case of two radio buttons with default names you can display that name with
a docvariable field - here {Docvariable varBtn} - and you can set the value
of that variable by using the macro code associated with the option button
eg

Option Explicit
Private oVars As Variables
Private Sub OptionButton1_Click()
Set oVars = ActiveDocument.Variables
If OptionButton1.Value = True Then
oVars("varBtn").Value = "OptionButton1 selected"
End If
ActiveDocument.Fields.Update
End Sub
Private Sub OptionButton2_Click()
Set oVars = ActiveDocument.Variables
If OptionButton2.Value = True Then
oVars("varBtn").Value = "OptionButton2 selected"
End If
ActiveDocument.Fields.Update
End Sub


--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



"Jeff Parker" wrote in message
...
Hi, in Word 2003, how can I display elesewhere in the doc the label
associated with the radio/option button that the user has selected? Has
this
something to do with Fields? I can't seem to work out how to do it. Any
thoughts please?



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
Tab button is deleting selected text. bjwz24 Microsoft Word Help 4 July 20th 10 03:39 AM
how do you make the "option button" work in a yes or no option? Annie Microsoft Word Help 1 June 11th 08 09:27 AM
Inserting table dependent option selected on a drop down box peterv Microsoft Word Help 5 April 19th 06 02:12 PM
screen tips on toolbars option not staying selected Gump Microsoft Word Help 7 April 9th 06 09:00 PM
displaying lines when using file label templates jennig0901 Microsoft Word Help 1 December 3rd 05 09:45 PM


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