Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 08-14-2013, 07:03 AM
czsti czsti is offline Activate/ select ContentControl Windows 7 32bit Activate/ select ContentControl Office 2010 32bit
Novice
Activate/ select ContentControl
 
Join Date: Aug 2013
Posts: 6
czsti is on a distinguished road
Default Activate/ select ContentControl

Hi,

how can I activate my created 'ContentControl' (cursor blinking in this one)?

I need something like this (marked by red color):



Code:
 
Dim i As Long
Dim myContentControl As contentControl
For i = 1 To ActiveDocument.ContentControls.Count
    If ActiveDocument.ContentControls(i).Title = "test" Then
        Set myContentControl = ActiveDocument.ContentControls(i)
    End If 
Next
 
myContentControl.Activate
Please help me
Reply With Quote
  #2  
Old 08-14-2013, 08:32 AM
gmaxey gmaxey is offline Activate/ select ContentControl Windows 7 32bit Activate/ select ContentControl Office 2010 (Version 14.0)
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,429
gmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the roughgmaxey is a jewel in the rough
Default

Select the range.

Code:
Sub ScratchMacro()
Dim i As Long
Dim myContentControl As ContentControl
  For i = 1 To ActiveDocument.ContentControls.Count
    If ActiveDocument.ContentControls(i).Title = "test" Then
      Set myContentControl = ActiveDocument.ContentControls(i)
      Exit For
    End If
  Next
  myContentControl.Range.Select
End Sub
why do you want to loop through all of the ccs to do this though? Why not:

Code:
Sub ScratchMacroII()
ActiveDocument.SelectContentControlsByTitle("test").Item(1).Range.Select
End Sub
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Activate/ select ContentControl check box will not activate survivo01 Word 1 10-04-2012 03:34 PM
Activate Office XP for the 4th time? bert2 Office 1 02-24-2012 10:22 PM
Activate/ select ContentControl Cannot Activate Office XP Pro (2003) wdare Office 3 02-13-2012 05:21 PM
Activate Office XP on Windows 7? scradock Office 1 02-12-2012 09:01 PM
Activate/ select ContentControl how do I activate office basic? madyfb Office 1 05-21-2009 11:18 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 07:15 AM.


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