![]() |
|
#2
|
||||
|
||||
|
Actually your checkboxes are named chckIEP and chckPsy
I would address this by adding the bookmark name and text values to the tag and ControlTipText properties on the relevant userform checkboxes. Then you implement the following code changes to the userform code - amend OK_Click and add the PopulateBM function. Code:
Private Sub OK_Click()
Application.ScreenUpdating = False
With ActiveDocument
.Bookmarks("bmDate").Range.Text = txtDate.Value
.Bookmarks("bmName").Range.Text = txtName.Value
.Bookmarks("bmUCI").Range.Text = txtUCI.Value
.Bookmarks("bmDOB").Range.Text = txtDOB.Value
.Bookmarks("bmSchool").Range.Text = txtSchool.Value
.Bookmarks("bmIEPY").Range.Text = txtIEPY.Value
.Bookmarks("bmPsyY").Range.Text = txtPsyY.Value
.Bookmarks("bmSC").Range.Text = txtSC.Value
PopulateBM Me.chckIEP
PopulateBM Me.chckPsy
End With
Application.ScreenUpdating = True
Unload Me
End Sub
Function PopulateBM(aCtl As Control)
Dim sBkmk As String, sText As String
sBkmk = aCtl.Tag
sText = aCtl.ControlTipText
With ActiveDocument
If .Bookmarks.Exists(sBkmk) Then
If aCtl Then
.Bookmarks(sBkmk).Range.Text = sText
Else
.Bookmarks(sBkmk).Range.Text = ""
End If
End If
End With
End Function
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Any efficient way to lock text that’s always written in a certain format? | Gilvv | Word | 25 | 11-25-2018 04:52 PM |
| Macro to insert different sets of text at bookmark depending on sequence of selected check boxes | chipper09 | Word VBA | 0 | 06-21-2018 01:49 PM |
Moving Selected Items from a Multiselect Listbox on a userform to a bookmark in Word
|
marksm33 | Word VBA | 3 | 01-15-2015 07:55 PM |
Getting mult resps. selected in listbox to concatenate & paste at a bookmark in Word
|
marksm33 | Word VBA | 3 | 01-15-2015 05:59 PM |
| Animation: text appears as if written by pen | ionas.iona | PowerPoint | 0 | 03-31-2011 05:23 PM |