#1
|
|||
|
|||
Auto Duplicating Text in Doc
Hi all,
I've been tweaking this doc for over a month now, so I know there's another version somewhere on the forum - feel free to combine with that story if necessary. I'm trying to cause the name listed under the "Sales Representative" dropdown at the top to auto populate again at the bottom of the first sheet above "Area Sales Manager". I think this should be done with cross references to a text style (as I've already done with my "Quotation Number" but I can't make it work with my drop down. I'm still learning so bullet-pointed instructions would be very helpful! Thanks in advance. Seth |
#2
|
||||
|
||||
It is not clear where you want the name duplicated, but the obvious solution is to use a cross reference to the control. The simplest way to do that is to download the second add-in from http://www.gmayor.com/BookmarkandVariableEditor.htm which facilitates the mapping of content controls to perform simple tasks like this. Then create a cross reference to the control in question and whatever you select in either will be reflected in the other.
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
#3
|
|||
|
|||
Hi - thanks for the reply. Are you referring to something available from the attached website's "Downloads" page? I get over 500 references to Add-Ins on the "What's New" page.
Seth |
#4
|
|||
|
|||
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 |
#5
|
||||
|
||||
Did you click the link in the earlier reply? The download link is near the bottom of the page.
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
|
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 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 |