![]() |
#1
|
|||
|
|||
![]() Hello, I came for the forum looking for an aswer I couldn't find anywhere else. I'm trying to prepare a form template with combo/drop down list, where shown values would be 4-lined (names and addresses, 20 positions). The dialog box of properites allows me to provide only a single-lined positions... I tried to copy a "new line" symbol from word itself, but it couldn't be pasted. Do you have any idea, how can I do it? Best regards for all, ksiebla |
#2
|
|||
|
|||
![]()
There is no such animal within Word. You could create a userform with a multi-column list or combobox or you can fudge and create a pseudo multi-line content control dropdown box.
Using the CC properties dialog, title the CC "Address", enter the person's name as the Text to Display and enter the full address as the value separated with "|" e.g., Jim Smith Jim Smith|123 Eaton Street|Suite 9A|Boston MA 12345 Use this code on CC exit: Code:
Private Sub Document_ContentControlOnExit(ByVal CC As ContentControl, Cancel As Boolean) Dim arrParts() As String Dim lngIndex As Long Select Case CC.Title Case "Address" If Not CC.ShowingPlaceholderText Then For lngIndex = 2 To CC.DropdownListEntries.Count If CC.Range.Text = CC.DropdownListEntries(lngIndex).Text Then arrParts = Split(CC.DropdownListEntries(lngIndex).Value, "|") Exit For End If Next lngIndex CC.Type = 1 CC.MultiLine = True For lngIndex = 0 To UBound(arrParts) Select Case lngIndex Case 0: CC.Range.Text = arrParts(lngIndex) & Chr(11) Case UBound(arrParts): CC.Range.Text = CC.Range.Text & arrParts(lngIndex) Case Else: CC.Range.Text = CC.Range.Text & arrParts(lngIndex) & Chr(11) End Select Next lngIndex CC.Type = wdContentControlDropdownList End If End Select End Sub |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
sugarjay | Word | 1 | 03-21-2017 07:20 PM |
Pasting a table with combo boxes to a new document looses the combo box | bobsut@enviro-consult.com | Word | 1 | 01-03-2017 01:29 PM |
Display multiple values as new values based on selection from template. | MvdB | Excel | 2 | 09-29-2015 08:51 PM |
![]() |
Mav | Excel Programming | 6 | 05-10-2015 08:42 PM |
![]() |
slade8200 | Word | 6 | 04-23-2014 01:40 PM |