Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #5  
Old 11-03-2017, 08:31 AM
FionaMcKenzie FionaMcKenzie is offline Auto Duplicating Text in Doc Windows 10 Auto Duplicating Text in Doc Office 2016
Novice
 
Join Date: Oct 2017
Location: Surrey, United Kingdom
Posts: 14
FionaMcKenzie is on a distinguished road
Default

Hi there,

Name the Content Control you want populated with the same text, i.e. set the Title Property.

Then this should work, e.g. Using SalesRep as the Title Property

Private Sub Document_ContentControlOnExit(ByVal ContentControl As ContentControl, Cancel As Boolean)
Dim i As Long
Dim oC As ContentControl
With ContentControl
If .Title = "Client" Then
For i = 1 To .DropdownListEntries.Count
If .DropdownListEntries(i).Text = .Range.Text Then
ActiveDocument.SelectContentControlsByTitle("Phone ")(1).Range.Text = Split(.DropdownListEntries(i).Value, "|")(0)
ActiveDocument.SelectContentControlsByTitle("Fax") (1).Range.Text = Split(.DropdownListEntries(i).Value, "|")(1)
ActiveDocument.SelectContentControlsByTitle("Email ")(1).Range.Text = Split(.DropdownListEntries(i).Value, "|")(2)

For Each oC In ActiveDocument.ContentControls
If oC.Title = "SalesRep" Then
oC.Range.Text = .Range.Text
Exit For
End If
Set oC = Nothing
Next oC
Exit For
End If
Next
End If
End With
Set oC = Nothing
End Sub
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Showing and hiding sections, duplicating text, etc. Networkrail Word 1 07-11-2017 02:14 PM
Figures keep duplicating telonghemu Word 2 10-19-2016 04:47 PM
Auto Duplicating Text in Doc Auto Text cschuett Word 4 10-25-2015 06:42 AM
Outlook is Duplicating PST Files DenverITGuy Outlook 0 06-12-2013 06:54 AM
Auto Text PineJ Office 1 03-21-2012 12:43 AM

Other Forums: Access Forums

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