Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 02-19-2014, 03:41 PM
macropod's Avatar
macropod macropod is offline Data from hidden internal tables feeding listboxes in same Word Document Windows 7 32bit Data from hidden internal tables feeding listboxes in same Word Document Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
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

I suppose the first issue you'll need to address is: How do you propose to hide the table and prevent its deletion?

Once you've resolved that little issue, your 'UserForm_Initialize' sub can be implemented as:
Code:
Private Sub UserForm_Initialize()
   Dim Rng As Range
    Me.lb1aa.ColumnCount = 1
     'Populate the listbox.
    With ActiveDocument.Tables(#)
        For i = 2 To .Rows.Count
             'Use .AddItem property to add a new row for each record and populate column 0
             Set Rng = .Cell(i, 1).Range
             Rng.End = Rng.End - 1
            .AddItem Rng.Text
        Next i
    End With
End Sub
where # is the index number of the table you're pulling the data from.

PS: When posting code, please use the code tags. They're on the 'Go Advanced' tab.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
 

Tags
internal source, listbox, table



Similar Threads
Thread Thread Starter Forum Replies Last Post
Data transfer from Word tables to Excel shoro Word 4 10-01-2013 05:08 AM
Data from hidden internal tables feeding listboxes in same Word Document Internal links in Word 2010 MKR Word 2 09-27-2013 05:30 PM
Data from hidden internal tables feeding listboxes in same Word Document Hidden tables? dluhop Word Tables 1 09-04-2011 02:41 AM
Data from hidden internal tables feeding listboxes in same Word Document Tables that carry hidden para styles Ulodesk Drawing and Graphics 4 03-10-2011 08:16 AM
*Big One* feeding sql server data into MS Word 2007 forms vafo Mail Merge 0 02-03-2010 04:49 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 09:10 PM.


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