Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 07-28-2020, 04:02 PM
Peterson Peterson is offline How to loop through content controls; if has text and has track changes, then accept Windows 10 How to loop through content controls; if has text and has track changes, then accept Office 2019
Competent Performer
How to loop through content controls; if has text and has track changes, then accept
 
Join Date: Jan 2017
Posts: 143
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
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Loop through controls, make certain controls invisible MacroWizard Word VBA 2 11-10-2015 02:36 PM
Loop and Update Content Controls with value vss712 Word VBA 7 08-27-2015 08:56 PM
How to loop through content controls; if has text and has track changes, then accept Rich text/Plain text Content Controls in Template michael.fisher5 Word 9 11-19-2014 06:36 AM
How to loop through content controls; if has text and has track changes, then accept Moving between Rich text content controls Sammie0Sue Word 4 03-12-2014 01:43 AM
How to loop through content controls; if has text and has track changes, then accept Rich Text Content Controls: Formatting? tinfanide Word VBA 8 03-04-2013 04:15 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 07:14 AM.


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