Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #6  
Old 03-17-2017, 09:01 PM
macropod's Avatar
macropod macropod is offline auto populate multiple text boxes dependent on a drop down Windows 7 64bit auto populate multiple text boxes dependent on a drop down Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
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

Using the document in the second link as an example, what I'd suggest for the replication is to have a text content control titled:
• 'Client' anywhere you want the client name replicated; and
• 'ClientDetails' anywhere you want the client details replicated,
coupled with the ContentControlOnExit macro re-coded as:
Code:
Private Sub Document_ContentControlOnExit(ByVal CCtrl As ContentControl, Cancel As Boolean)
Application.ScreenUpdating = False
Dim i As Long, StrDetails As String
With CCtrl
  If .Title = "Client" Then
    If .Type <> wdContentControlDropdownList Then Exit Sub
    For i = 1 To .DropdownListEntries.Count
      If .DropdownListEntries(i).Text = .Range.Text Then
        StrDetails = Replace(.DropdownListEntries(i).Value, "|", Chr(11))
        Exit For
      End If
    Next
    With ActiveDocument.SelectContentControlsByTitle("Client")
      For i = 2 To .Count
        If CCtrl.Range.Text = CCtrl.PlaceholderText Then
          .Item(i).Range.Text = ""
        Else
          .Item(i).Range.Text = CCtrl.Range.Text
        End If
      Next
    End With
    With ActiveDocument.SelectContentControlsByTitle("ClientDetails")
      For i = 1 To .Count
        .Item(i).Range.Text = StrDetails
      Next
    End With
  End If
End With
Application.ScreenUpdating = True
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
auto populate multiple text boxes dependent on a drop down Auto Populate Text On Dependent Drop Down Exit GregStewartPTC Word VBA 2 02-27-2017 05:37 AM
auto populate multiple text boxes dependent on a drop down How to populate dependent dropdowns and auto-fill text fields simultaneously? vera Word VBA 1 10-07-2016 07:41 PM
VBA coding for multiple drop-down lists to populate a text box for each list yeatropulo Word VBA 14 11-11-2015 01:08 PM
auto populate fields for multiple files w/in folder jbyrd Word 0 07-21-2014 07:35 AM
Auto populate text help i'm stuck! Word 1 08-13-2010 11:52 AM

Other Forums: Access Forums

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