Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 11-05-2013, 06:32 AM
Sammie0Sue Sammie0Sue is offline Content Controls Windows 7 64bit Content Controls Office 2010 64bit
Novice
Content Controls
 
Join Date: Nov 2013
Posts: 21
Sammie0Sue is on a distinguished road
Default Content Controls

i have used hundreds of Content Control boxes/fields in my Word doc and I realized I forgot to check the option "Content Control can not be deleted" is there a macro/VBA code that will run through the doc and apply the option to all content control boxes?



I have use drop down boxes and rich text boxes only
Reply With Quote
  #2  
Old 11-05-2013, 09:05 AM
Charles Kenyon Charles Kenyon is offline Content Controls Windows 7 64bit Content Controls Office 2013
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 9,082
Charles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant future
Default

I'm sure one can be written. I don't have one on the shelf.
You might want to change the title of your question to make it more specific:
"Change all Content Controls in a document to non-deletion using VBA" would be a suggestion.

One other thing is I would suggest that you want a document template rather than a document if you are going to be using this to generate new documents. Templates in Microsoft Word
Reply With Quote
  #3  
Old 11-06-2013, 06:50 AM
Sammie0Sue Sammie0Sue is offline Content Controls Windows 7 64bit Content Controls Office 2010 64bit
Novice
Content Controls
 
Join Date: Nov 2013
Posts: 21
Sammie0Sue is on a distinguished road
Default

Thanks for the suggestions but the form I am creating is the template

You will see I have updated the title as asked
Reply With Quote
  #4  
Old 11-06-2013, 10:59 AM
Charles Kenyon Charles Kenyon is offline Content Controls Windows 7 64bit Content Controls Office 2013
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 9,082
Charles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant future
Default Change all Content Controls in a document to non-deletion using VBA

Quote:
Originally Posted by Sammie0Sue View Post
Thanks for the suggestions but the form I am creating is the template

You will see I have updated the title as asked
Nope, I don't see it.
Reply With Quote
  #5  
Old 11-06-2013, 01:00 PM
Charles Kenyon Charles Kenyon is offline Content Controls Windows 7 64bit Content Controls Office 2013
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 9,082
Charles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant future
Default

The following might work:
Code:
Sub ChangeCCToNoDelete()
    ' Macro to set all Content Controls to locked (no delete)
    ' Written by Charles Kenyon 2013-11-06
    Dim oCC As ContentControl
    For Each oCC In ActiveDocument.ContentControls
        oCC.LockContentControl = True
    Next oCC
End Sub
See Installing Macros for direction on how to use this.

I have not tested this extensively, but it seems to work.
Reply With Quote
  #6  
Old 11-06-2013, 10:48 PM
Sammie0Sue Sammie0Sue is offline Content Controls Windows 7 64bit Content Controls Office 2010 64bit
Novice
Content Controls
 
Join Date: Nov 2013
Posts: 21
Sammie0Sue is on a distinguished road
Default

Thank I will give it a try!
Reply With Quote
  #7  
Old 11-06-2013, 10:56 PM
Sammie0Sue Sammie0Sue is offline Content Controls Windows 7 64bit Content Controls Office 2010 64bit
Novice
Content Controls
 
Join Date: Nov 2013
Posts: 21
Sammie0Sue is on a distinguished road
Default

Wonderful thank you it has worked!!
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using both rich and plain content controls in one document Erica.Black Word 0 06-18-2013 10:33 AM
Content Controls Rich Text Content Controls: Formatting? tinfanide Word VBA 8 03-04-2013 04:15 AM
Macro to link 2 content controls bortonj88 Word VBA 2 08-21-2012 06:24 AM
Content Controls Form Programming beachdog Word VBA 4 09-20-2011 10:26 AM
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:26 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