![]() |
|
#2
|
||||
|
||||
|
Try this version
Code:
Sub ResetCCs()
Dim aCC As ContentControl, iType As Integer
For Each aCC In ActiveDocument.ContentControls
With aCC
Select Case .Type
Case wdContentControlText, wdContentControlRichText, wdContentControlDate
.Range.Text = ""
Case wdContentControlComboBox, wdContentControlDropdownList
.DropdownListEntries(1).Select
Case wdContentControlCheckBox
.Checked = False
Case wdContentControlBuildingBlockGallery
iType = .Type
.Type = wdContentControlRichText
.Range.Text = ""
Do While .Range.Tables.Count > 0
.Range.Tables(1).Delete
Loop
.Type = iType
End Select
End With
Next aCC
End Sub
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia Last edited by Guessed; 04-13-2022 at 11:30 PM. Reason: Amended to deal with tables in Building Block CCs |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| collabrate bulding block gallery or text content | samouti | Word | 7 | 05-07-2019 06:56 AM |
| Reference a Building block gallery control from another Field and insert text using If logic | Flynny | Word VBA | 3 | 07-30-2018 08:34 PM |
| How-to: Add a quickpart, field or Building Block Gallery Content Control based on a UserForm | HighSierra | Word VBA | 0 | 05-06-2015 08:20 PM |
| Using Building Block Gallery Content function on a form with restricted editing | wes228 | Word VBA | 1 | 08-28-2014 08:14 AM |
| how to make building block content control determine bb to display elsewhere | jamles12 | Word VBA | 5 | 11-16-2013 11:38 AM |