Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 03-01-2020, 02:41 PM
macropod's Avatar
macropod macropod is offline Content Controls - Dependent Dropdown & Text Windows 7 64bit Content Controls - Dependent Dropdown & Text Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,516
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Updated. Try it now.


Quote:
Is the added sub so I only need to change the tutor info in one properties box for them all to change?
That is quite possible, but I was loath to assume every reference to a tutor should be changed. The current approach requires each subject & session run by that tutor to at least be considered, which is a safeguard against both: (a) updating all instances when only a few need updating; and (b) overlooking some if they were to be done manually (which is still possible). For code to update all instances, you might use:
Code:
Sub BulkUpdateTutor()
Dim i As Long, j As Long, OldTutor As String, NewTutor As String
OldTutor = Trim(InputBox("Old Tutor"))
NewTutor = Trim(InputBox("New Tutor", , OldTutor))
If OldTutor = "" Then Exit Sub
With ActiveDocument
  For i = 1 To .SelectContentControlsByTitle("Subject").Count
    With .SelectContentControlsByTag("Subject_" & i)(1)
      For j = 1 To .DropdownListEntries.Count
        With .DropdownListEntries(j)
          If Trim(.Value) = OldTutor Then
            .Value = Replace(.Value, OldTutor, NewTutor)
          End If
        End With
      Next
    End With
  Next
End With
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Content Controls - Dependent Dropdown & Text Content Controls - Dependent Dropdown someazguy Word VBA 14 02-05-2023 08:01 PM
Content Controls - Dependent Dropdown & Text Multiple dependent dropdown lists in table with add new row option jeweldarby Word VBA 6 05-21-2022 04:37 PM
Content Controls - Dependent Dropdown & Text Dependent dropdown and repeat section NLJ Word VBA 3 01-12-2020 05:00 PM
Content Controls - Dependent Dropdown & Text Dropdown Menu Dependent on a Previous Drop Down lgsikaffy Word VBA 3 12-14-2018 05:14 PM
Dropdown dependent text JakeLRL Word VBA 7 04-07-2016 08:26 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 12:34 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