Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 02-21-2011, 10:36 PM
cksm4 cksm4 is offline Grouping Content Controls Windows XP Grouping Content Controls Office 2007
Advanced Beginner
Grouping Content Controls
 
Join Date: Aug 2010
Posts: 48
cksm4 is on a distinguished road
Unhappy Grouping Content Controls

I am really in need of help on this one! I want to group content controls. Easily done by using:



Code:
 
Selection.Range.ContentControls.Add(wdContentControlGroup)
However, I am trying to use a set range so that a selection is not visible to the user. No matter how I try this code it will not work on a set range:

Code:
 
Dim cc As Word.ContentControl
Dim rng As Range
Set rng = ActiveDocument.Range
Set cc = rng.ContentControls.Add(wdContentControlGroup)
or

Code:
 
Dim cc As Word.ContentControl
Dim rng As Range
Set rng = ActiveDocument.Range
Set cc = .ContentControls.Add(wdContentControlGroup, rng)
HELP!

Thanks
Brock
Reply With Quote
  #2  
Old 02-27-2011, 08:33 PM
macropod's Avatar
macropod macropod is offline Grouping Content Controls Windows 7 32bit Grouping Content Controls Office 2000
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
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

Hi Brock,

See: http://social.msdn.microsoft.com/For...-61b9d32967e4/

Intersetingly, your second code snippet works for me provided a content control is selected.

If you need to work with selections, you can use 'Application.ScreenUpdating = False' to hide what you're doing from the user and, if you set a range to the user's selection before making any selections with your own code, then re-select that range afterwards, the user need never know the selection had changed in the interim.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 03-01-2011, 12:46 PM
cksm4 cksm4 is offline Grouping Content Controls Windows XP Grouping Content Controls Office 2007
Advanced Beginner
Grouping Content Controls
 
Join Date: Aug 2010
Posts: 48
cksm4 is on a distinguished road
Default

I guess this will show my limited, but growing knowledge... 'Application.ScreenUpdating = False' is a new find me me. What a great command... thanks!!
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Grouping Content Controls Grouping text boxes daviddoria PowerPoint 1 07-26-2010 06:12 AM
Package for CD with links to Windows media player content and Flash Shockwave content hectorh PowerPoint 4 10-15-2009 12:22 PM
Grouping - expand all ejohns Excel 0 07-17-2009 07:15 AM
Can't Download Controls BillTheAdmin Project 2 12-05-2005 10:20 AM
How to do grouping in Excel volcane Excel 2 04-30-2005 09:23 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:34 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