Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 12-11-2017, 10:06 PM
lvganesh lvganesh is offline How to insert bookmarks for content or Text of ContentControl Windows 7 64bit How to insert bookmarks for content or Text of ContentControl Office 2013
Novice
How to insert bookmarks for content or Text of ContentControl
 
Join Date: Dec 2017
Posts: 2
lvganesh is on a distinguished road
Post How to insert bookmarks for content or Text of ContentControl

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
Reply With Quote
  #2  
Old 12-11-2017, 11:48 PM
macropod's Avatar
macropod macropod is offline How to insert bookmarks for content or Text of ContentControl Windows 7 64bit How to insert bookmarks for content or Text of ContentControl Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

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]
Reply With Quote
  #3  
Old 12-12-2017, 05:59 AM
gmayor's Avatar
gmayor gmayor is offline How to insert bookmarks for content or Text of ContentControl Windows 10 How to insert bookmarks for content or Text of ContentControl Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,101
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

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
Reply With Quote
  #4  
Old 12-12-2017, 08:25 AM
lvganesh lvganesh is offline How to insert bookmarks for content or Text of ContentControl Windows 7 64bit How to insert bookmarks for content or Text of ContentControl Office 2013
Novice
How to insert bookmarks for content or Text of ContentControl
 
Join Date: Dec 2017
Posts: 2
lvganesh is on a distinguished road
Default

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
Reply With Quote
  #5  
Old 12-12-2017, 09:38 PM
gmayor's Avatar
gmayor gmayor is offline How to insert bookmarks for content or Text of ContentControl Windows 10 How to insert bookmarks for content or Text of ContentControl Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,101
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

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
Reply With Quote
  #6  
Old 12-12-2017, 11:27 PM
macropod's Avatar
macropod macropod is offline How to insert bookmarks for content or Text of ContentControl Windows 7 64bit How to insert bookmarks for content or Text of ContentControl Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Quote:
Originally Posted by gmayor View Post
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.
I agree. Trying to bookmark part of a variable range is fraught with difficulties.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply

Tags
contentcontrol



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to insert bookmarks for content or Text of ContentControl Insert Rich Text Content Control in specific position, Word 2013 VBA 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
How to insert bookmarks for content or Text of ContentControl Form updating Bookmarks - writes to the bookmarks multiple times PeterPlys Word VBA 13 01-14-2015 06:41 AM
Insert image in bookmarks kroz Word VBA 0 11-29-2010 04:55 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 07:53 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft