View Single Post
 
Old 06-13-2019, 11:58 AM
jhansrod jhansrod is offline Windows 10 Office 2016
Novice
 
Join Date: Jun 2019
Posts: 16
jhansrod is on a distinguished road
Default

Thank you and kindly excuse me if I am not being clear.

I have the code as per below which works great, however I would like to take different parts of the result and have them used in different part of the documents.

The example output of the below as follows:

Drop-Down List Content Control PROPERTIES:
Display Name = Head Office
Value = StreetAddress|Boxaddress|TelNo|Email

CODE:
If .Title = "OFFICE" Then
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
ActiveDocument.ContentControls(2).Range.Text = StrDetails
End If

OUTPUT:
StreetAddress
BoxAddress
TelNo
Email


REQUIREMENT:
Plain Text Content Control to be assigned values as follows:
StAdr = StreetAddress
BxAdr = Boxaddress
TNo = TelNo
Eml = Email

With this, one can place and use the values anywhere needed in the document.

Thank you
J
Reply With Quote