Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 06-12-2016, 04:30 AM
macropod's Avatar
macropod macropod is offline Bookmark content controls Windows 7 64bit Bookmark content controls Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,516
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

Assuming the content controls to be bookmarked are all in table cells, you could use:



Code:
Sub Demo()
Application.ScreenUpdating = False
Dim CCtrl As ContentControl, Rng As Range
For Each CCtrl In ActiveDocument.ContentControls
  With CCtrl
    If .Range.Information(wdWithInTable) = True Then
      Set Rng = .Range.Cells(1).Range
      With Rng
        .End = .End - 1
        .Bookmarks.Add CCtrl.Title, Rng
      End With
    End If
  End With
Next
Application.ScreenUpdating = True
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #2  
Old 06-12-2016, 05:55 AM
silverspr silverspr is offline Bookmark content controls Windows 8 Bookmark content controls Office 2010 64bit
Novice
Bookmark content controls
 
Join Date: Apr 2011
Posts: 24
silverspr is on a distinguished road
Default

Thank you again! This worked swimmingly! I neglected to mention I have a "label" in front of the content control i.e. rating: or score: The control content is being displayed with the words rating or score and the value of the content control as they are both in the same cell. I suppose I could remove the label!

I presume I can set this with the .end property? I haven't played with it yet...

thanks again
Reply With Quote
Reply

Tags
bookmark;content control

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
VBA for content controls ciresuark Word VBA 1 03-10-2015 03:14 PM
Calculate Age From Content Controls kintap Word VBA 10 07-02-2014 09:25 AM
Content Controls in Headers ejungk99 Word 2 06-16-2014 04:02 PM
Bookmark content controls Content Controls Sammie0Sue Word 6 11-06-2013 10:56 PM
Bookmark content controls Grouping Content Controls cksm4 Word VBA 2 03-01-2011 12:46 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 11:40 AM.


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