Insert Text dependant on checkbox behavior`

V

vik.sinha

Hi All.

I am very new to VBA (extremely) and would like to achive the
following:

Checkbox 1 - Remediated
Checkbox 2 - Accept
Checkbox 3 - Continue


If the user selects (ticks) checkbox 1: I need a certain paragraph
(paragraph1) to be added below the checkbox and remove the other
checkboxes.

The same to happen if I select the other checkboxes.

Example:

Checkbox 1 - Remediated (checked)

The following pending items were remediated:

Item 1
Item 2
Item 3

Signature Line: ______________________________
Date:____________________

{End example}

Is this possible? Do I use bookmarks to insert the text or auto text,
do i even need a vba script or just a macro will suffice.

Any help would be appreciated
 
F

fumei via OfficeKB.com

Many possibilities. Are these formfields (inserted with the Forms toolbar),
or ActiveX checkboxes (inserted with the Controls toolbar)?

Have you considered not using three checkboxes, but one dropdown? The users
selects one of the three choices, and you go on from there?

But yes, it is possible. If the text to be inserted is standard, then
AutroText would work fine.
 
N

n/a

Thanks for the reply.

Currently they checkboxes are from Control toolbar. I could use a drop
down menu if this makes coding easier.

As far as auto text, I messed around with it but perhaps I am not
doing it correctly. I thought auto text does only single line or text
such as "confidential, personal" etc. And not a formatted paragraph?

I tried this with a bookmark but the bookmark text is always visible:

Private Sub CheckBox2_Click()
Selection.Collapse Direction:=wdCollapseEnd
Selection.FormattedText = ActiveDocument.Bookmarks("accept").Range
'Selection.FormattedText = ActiveDocument.Tables(Table 1).Range
End Sub

Thanks Again,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top