View Single Post
 
Old 07-28-2020, 04:02 PM
Peterson Peterson is offline Windows 10 Office 2019
Competent Performer
 
Join Date: Jan 2017
Posts: 141
Peterson is on a distinguished road
Default How to loop through content controls; if has text and has track changes, then accept

I need to create a macro that will loop through all stories; in each story, I need to loop through all of the content controls with text. If the control contains a tracked change, then accept the change.


But I'm stuck at this point:
Code:
Sub ContentControlRevisions_Accept()
  
    Dim objCC As ContentControl
    Dim rngStoryRange As Range
  
    For Each rngStoryRange In ActiveDocument.StoryRanges
    
        For Each objCC In Rng.ContentControls
      
            'If the content control type is text

                ' If the content control contains track changes Then
            
                ' ...accept the track changes in the content control
                
                End If
      
            End If
    
        Next objCC
  
    Next rngStoryRange
  
 End Sub
How can I identify if the content control as track changes? Or am I doing this backwards, and I need to loop through all track changes and determine if any have some sort of content control attribute?


Thanks
Reply With Quote