![]() |
|
#3
|
||||
|
||||
|
Another way is to use the following macro to write your values to the bookmarks
You can then call it from your form e.g. Code:
FillBM "bmDate", txtDate.Value FillBM "bmName", txtName.Value For optional insertions Code:
If chckIEP.Value = True Then
FillBM "bmIEP", "Request IEP"
Else
FillBM "bmIEP", ""
End If
Code:
Public Sub FillBM(strbmName As String, strValue As String)
'Graham Mayor - http://www.gmayor.com
Dim orng As Range
With ActiveDocument
On Error GoTo lbl_Exit
Set orng = .Bookmarks(strbmName).Range
orng.Text = strValue
orng.Bookmarks.Add strbmName
End With
lbl_Exit:
Set orng = Nothing
Exit Sub
End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
|
|
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 |