Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 06-07-2021, 03:53 PM
Guessed's Avatar
Guessed Guessed is offline Clear Button For Specific Content Control Windows 10 Clear Button For Specific Content Control Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,176
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

I would use a consistent Tag value in each CC that needs to be wiped by the macro. For example, set the Tag property to "Annual" for the plain text CCs you want to wipe.

The macro that then wipes those ones (at its simplest) would be
Code:
Sub DeciduousCCs()
  Dim aCC As ContentControl
  For Each aCC In ActiveDocument.SelectContentControlsByTag("Annual")
    aCC.Range.Text = ""
  Next aCC
End Sub
You might need to complicate this if it doesn't work with the CC types in your document.
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
 

Tags
clearcontents, content control, vba

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help to get a word document to send specific content via email using submit button ActualJax Word VBA 2 07-06-2020 04:18 PM
Clear Button For Specific Content Control Finding specific Content Control based on both title and tag ZaSpai Word VBA 4 03-31-2019 11:37 AM
Adding Row with Content control using Command Button baes10 Word VBA 0 12-13-2017 11:30 AM
Content Control Option Button Oops warbird Word VBA 5 12-07-2017 06:53 AM
Clear Button For Specific Content Control Code to Sum Column of Content Control Values In Specific Tables? warbird Word VBA 2 07-13-2015 05:44 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 04:21 PM.


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