![]() |
|
#2
|
||||
|
||||
|
The optimum approach is to use content controls to accept the data as they are much more robust than bookmarks. For a text content control the following can be used to write a value from your userform to the appropriate control. Where there is no datato write to a control set the strValue to ChrW(8203) i.e. a zero length space.
Code:
Public Sub FillCC(strCCTitle As String, strValue As String)
Dim CCtoFillRng As Range
Set CCtoFillRng = ActiveDocument.SelectContentControlsByTitle(strCCTitle).Item(1).Range
CCtoFillRng.Text = strValue
lbl_Exit:
Set CCtoFillRng = 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 |
Deleting only all bookmarks contents not the bookmarks
|
adilprodigy | Word VBA | 1 | 10-11-2017 01:31 PM |
Form fields and bookmarks restrictions
|
AttiCuS | Word VBA | 11 | 04-19-2016 02:40 AM |
Form updating Bookmarks - writes to the bookmarks multiple times
|
PeterPlys | Word VBA | 13 | 01-14-2015 06:41 AM |
How To Find Bookmarks and/or custom fields Inside Building Blocks, Office 2010
|
thpanos | Word | 3 | 02-17-2013 08:49 AM |
| autopopulating REF fields + bookmarks | valz | Word | 10 | 09-01-2011 08:18 AM |