Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 05-09-2017, 02:56 AM
wwwk wwwk is offline Multi-lined combo-box values Windows 7 64bit Multi-lined combo-box values Office 2013
Novice
Multi-lined combo-box values
 
Join Date: May 2017
Posts: 1
wwwk is on a distinguished road
Default Multi-lined combo-box values


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
Reply With Quote
  #2  
Old 05-09-2017, 03:26 AM
gmaxey gmaxey is offline Multi-lined combo-box values Windows 7 32bit Multi-lined combo-box values Office 2016
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,617
gmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nice
Default

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
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Multi-lined combo-box values Multi-column combo box content control? 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
Multi-lined combo-box values Lookup / Paste Multi Values VBA Mav Excel Programming 6 05-10-2015 08:42 PM
Multi-lined combo-box values Heading Arrow Not Lined Up With Text slade8200 Word 6 04-23-2014 01:40 PM

Other Forums: Access Forums

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