![]() |
#1
|
|||
|
|||
![]()
Hi ,
I have a question regarding inserting bookmarks of ContentControl Text. I am am trying to insert bookmarks for content/Text of ContentControl for Word 2013 or higher. When I am doing programetically throwing below error. "This method or property is not available because the current selection partially covers a plain text content control." My question is , is there any possibility to insert bookmark on ContentControl Text. Example: There is a text in Combo Box Content Control like "Please Select Countries". I want to bookmark "Countries". Please let me know the way to bookmark the text Countries. Thanks In Advance.. Ganesh |
#2
|
||||
|
||||
![]()
You could use code like:
Code:
Dim Rng As Range With ActiveDocument Set Rng = .ContentControls(1).Range With Rng .End = .End + 1 .Start = .Start - 1 End With .Bookmarks.Add Name:="Bookmark", Range:=Rng End With
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#3
|
||||
|
||||
![]()
If the aim is to reproduce the content of the content control elsewhere, you would be better using mapped content controls with cross references, then whatever you enter in one is reproduced in the other(s).
To aid that see the second half of http://www.gmayor.com/BookmarkandVariableEditor.htm
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
#4
|
|||
|
|||
![]()
Hi Paul,
Thanks for the reply. Sounds like it bookmarks enter content control, but the requirement is to bookmark part of content control text in Word 2013 and higher. Ganesh |
#5
|
||||
|
||||
![]()
Bookmark 'part' of content control text? How could that work? The whole point of content controls is that they include variable texts. How does a bookmark sit with that? If you are inserting texts using VBA and you want to bookmark part of that inserted text, you would be better setting a range to the location and inserting the text and the bookmark there, rather than use content controls as location markers.
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
#6
|
||||
|
||||
![]() Quote:
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
![]() |
Tags |
contentcontrol |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
LaurenM | Word VBA | 13 | 12-01-2017 02:07 AM |
How can I insert a table of content slightly differing from the headings in the text? | Tobinobi | Word | 4 | 09-25-2017 05:47 AM |
How to insert a table using bookmarks in a document | Catty | Word VBA | 3 | 05-04-2015 03:05 AM |
![]() |
PeterPlys | Word VBA | 13 | 01-14-2015 06:41 AM |
Insert image in bookmarks | kroz | Word VBA | 0 | 11-29-2010 04:55 AM |