View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
K[_2_] K[_2_] is offline
external usenet poster
 
Posts: 557
Default How to Get Files.FullName

I have macro (see below) which put all kind of files names in ListBox1
from specified folder

Private Sub CommandButton1_Click()
Me.ListBox1.Clear
Dim Filename As String
Dim Foldername As String

Foldername = "C:\Documents and Settings\Files\"
Filename = Dir(Foldername)
Do Until Filename = ""
Me.ListBox1.AddItem (Filename)
Filename = Dir
Loop
End Sub

How can I get files full name or path in ListBox1. For example get
name like "C:\Documents and Settings\Files\Flag.pdf" instead of
"Flag.pdf". I know there is some modification needed in macro above
can any friend help.