|
-
Feb 2nd, 2007, 03:58 AM
#1
Thread Starter
New Member
[RESOLVED] sorting record in Listbox
Hi guys and gurus, i'm new to VB programming so please bare with me 
i'm making a MACRO shortcut in MSWord which will invoke name of people. I'm using the bundled VB program of MSWord under macros. My problem is, how would i be able to show the names in alphabetical order?.. here's my simple program for a simple minded like me 
C:\Refer\Refer01.txt (input)
Poohkyaw, Many
Yu, Ester
Polopot, Patty
Listbox1 (output)
Polopot, Patty
Poohkyaw, Many
Yu, Ester
VB Code:
Private Sub UserForm_Initialize()
Open "C:\Refer\Refer01.txt" For Input As #1
Do While Not EOF(1)
i = 0
Line Input #1, inputline$
ListBox1.AddItem inputline$, i
Loop
ListBox1.Text = ListBox1.List(1, 0)
Close 1
End Sub
How should i go about this?
thanks in advance guys..
Last edited by spectator; Feb 2nd, 2007 at 04:03 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|