Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Closed Thread
 
Thread Tools Display Modes
  #1  
Old 10-26-2017, 01:25 AM
macropod's Avatar
macropod macropod is offline How to import list from Excel into drop-down list into word Windows 7 64bit How to import list from Excel into drop-down list into word Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,521
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default


The important thing about what's in the link is that it demonstrates how you can use document variables. The method of getting the data into and out of it/them needn't necessarily be as complex as it was for that thread, where data from multiple workbooks and worksheets were being collated.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
  #2  
Old 11-22-2017, 08:27 PM
kinimv kinimv is offline How to import list from Excel into drop-down list into word Windows 10 How to import list from Excel into drop-down list into word Office 2016
Novice
 
Join Date: Oct 2017
Location: Seattle, WA
Posts: 9
kinimv is on a distinguished road
Default

Hey macropod, I successfully found a way around the character limit by storing the excel columns as arrays.

However, in other parts of my document, I am still using value to fill in multiple fields from the dropdown. Which brings me to my question: In your first post in this thread, your code included the following:

Code:
 With xlWkBk
      With .Worksheets(StrWkShtNm)
        ' Find the last-used row in column A.
        LRow = .Cells(.Rows.Count, 1).End(xlUp).Row
        ' Populate the content control titled 'ID', with Column A for the 'ID' as the
        ' content control Text and the values from columns B-E as the content control
        ' value, using a "|" separator
        ActiveDocument.SelectContentControlsByTitle("ID")(1).DropdownListEntries.Clear
        For i = 1 To LRow
          ActiveDocument.SelectContentControlsByTitle("ID")(1).DropdownListEntries.Add _
            Text:=Trim(.Range("A" & i))
          'or, for example, to add the contents of column B to the content control's 'value':
          'ActiveDocument.SelectContentControlsByTitle("ID")(1).DropdownListEntries.Add _
            Text:=Trim(.Range("A" & i)), Value:=Trim(.Range("B" & i))
        Next
      End With
    .Close False
  End With
I can get the contents of column B to be my value, but I cannot see how the value can be from B-E columns using a "|" separator. Is that part missing from your code, or am I missing something?
Thanks
Closed Thread

Tags
lesson plan template, teacher help



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to import list from Excel into drop-down list into word Dynamically changing drop-down list based on selection? (Word Form) laurarem Word 1 02-21-2013 10:17 PM
How to import list from Excel into drop-down list into word How to import a list of names into PowerPoint from Excel? CarpetRemnant PowerPoint 4 12-07-2012 11:08 AM
Drop down list, Can it be done??? garethreid Outlook 0 08-09-2012 06:08 AM
How to import list from Excel into drop-down list into word drop down list from external data source Excel 2007? Intruder Excel 1 08-03-2012 05:41 AM
Long List for drop down box DLo99 Word 0 02-28-2010 08:07 AM

Other Forums: Access Forums

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