Instert text, by clicking radio button from form 
Author Message
 Instert text, by clicking radio button from form
News Group,

I would tremendously appreciate help on this matter.

I created a form with 4 radio buttons that I wish to "pop
up" to a user opens the word document.  When any of the
radio buttons are selected, I need the text associated
with them to be input in the center of the footer (font -
Arial, size - 6 point).

Does anyone know the code I will need to place in the
subroutine of my module, in order to get this working
correctly.  It seems as though I developed the form
correctly, but I just don't know how to connect it to
code, nor do I know the code to use.  Thank you for be
patient with me, I am a beginner.

Jules



Sun, 02 Jan 2005 05:17:56 GMT  
 Instert text, by clicking radio button from form
Hi Julie,

Go to the footer, tab to the centre tab position and press the spacebar to
insert a space.  Now select the space and insert a bookmark so that when you
have the View Bookmarks option set under Tools>Options>View, the bookmark
looks like [] rather than just a single |.

Now on your Userform, add a command button as well as the radio buttons and
use the following code (modified as necessary to reflect the name of your
bookmark and the text that you want to insert, for the Command Button Click
event

Private Sub CommandButton1_Click()
Dim mytext As String
If OptionButton1.Value = True Then
    mytext = "OptionButton1 Text"
ElseIf OptionButton2.Value = True Then
    mytext = "OptionButton2 Text"
ElseIf OptionButton3.Value = True Then
    mytext = "OptionButton3 Text"
Else
    mytext = "OptionButton4 Text"
End If
ActiveDocument.Bookmarks("test").Range.InsertBefore mytext
ActiveDocument.Bookmarks("test").Range.Font.Size = 6
UserForm1.Hide
End Sub

Please post any response to the newsgroups for the benefit of others who may
also be following the thread.

Hope this helps,
Doug Robbins - Word MVP

Quote:
> News Group,

> I would tremendously appreciate help on this matter.

> I created a form with 4 radio buttons that I wish to "pop
> up" to a user opens the word document.  When any of the
> radio buttons are selected, I need the text associated
> with them to be input in the center of the footer (font -
> Arial, size - 6 point).

> Does anyone know the code I will need to place in the
> subroutine of my module, in order to get this working
> correctly.  It seems as though I developed the form
> correctly, but I just don't know how to connect it to
> code, nor do I know the code to use.  Thank you for be
> patient with me, I am a beginner.

> Jules



Sun, 02 Jan 2005 19:18:25 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Sort the table by clicking on the radio button

2. HLP: Radio Button Click Event

3. how can i generete a event procedure by clicking a radio button

4. Clearing radio buttons without firing click event

5. reading data from text boxes and radio buttons

6. Help needed for Frames, text boxes, radio buttons and scrolling (F^2)

7. Help with Radio Buttons in Word forms

8. Radio button value from one form to another.

9. Names of all radio button objects in a form

10. Radio buttons and Form Validation

11. Right Button Click emulating Left Button Click

12. Form Location after Clicking Form's Restore Button

 

 
Powered by phpBB® Forum Software