Home |
Search |
Today's Posts |
#3
![]()
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
![]()
So will I need to change the verbiage on the macro you gave me below for each
pop-up? Meaning, everywhere you have NUR1, I need to change this to a new name per checkbox? "Graham Mayor" wrote: It's a bit complicated and requires vba, however assuming 'Nursery' is a checkbox 'Check1' and you have a bookmark placed where you want the field to appear named 'Nursery'. The following macro run on exit from Check1 will enter or remove a form field 'Nur1' according to the setting of Check1. http://www.gmayor.com/installing_macro.htm You will need similar macros with different bookmarks for each check box that you wish to be associated with such a pop up field. Sub ExitCHK1() Dim bProtected As Boolean 'Unprotect the file If ActiveDocument.ProtectionType wdNoProtection Then bProtected = True ActiveDocument.Unprotect Password:="" End If 'Check whether Checkbox1 is checked If ActiveDocument.FormFields("Check1").CheckBox.Value = True Then 'Trap the non-existence of field "Nur1" On Error GoTo AddField: 'Check if there is a field already place and if so delete it With Selection .GoTo What:=wdGoToBookmark, Name:="Nur1" .Delete Unit:=wdCharacter, Count:=1 End With AddField: 'Locate the field position bookmark and add a form field "Nur1" With Selection .GoTo What:=wdGoToBookmark, Name:="Nursery" .FormFields.Add Range:=Selection.Range, Type:= _ wdFieldFormTextInput .PreviousField.Select End With Selection.FormFields(1).Name = "Nur1" GoTo Finished: Else 'Checkbox is unchecked On Error GoTo CleanUp: 'There is no field so finish and reprotect the form 'Remove the form field if it exists With Selection .GoTo What:=wdGoToBookmark, Name:="Nur1" .Delete Unit:=wdCharacter, Count:=1 End With End If CleanUp: 'Goto the next field - here check box 2 Selection.GoTo What:=wdGoToBookmark, Name:="Check2" 'Reprotect the document. Finished: If bProtected = True Then ActiveDocument.Protect _ Type:=wdAllowOnlyFormFields, NoReset:=True, Password:="" End If End Sub -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Victoria wrote: Is there a way to have a text box field pop up when a check box is checked? Example: 1. Please check the boxes that you would like to work on: [check box] - Nursery [check box] - Welcome Center [check box] - Hospitality Say the Nursery box is checked, is there a way to have something like this pop up automatically: Nursery - [text field] So for example: the "text field" will be where the person would enter their availability |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
do not check spelling and grammar is automatically checked | Microsoft Word Help | |||
keeping checked check boxes | Microsoft Word Help | |||
How do I format a check box to be checked when double clicked? | Microsoft Word Help | |||
Why does the custom dictionary check box not stay checked? | Microsoft Word Help | |||
Hightlite a check box when the checkbox is checked | Microsoft Word Help |