file = dir vba code example
Example: vb6 dir
Sub PrintFolderList()
Dim strPath As String
Dim strFile As String
Dim strFileSpec As String
Dim strFilesFound As String
strPath = "Z:\Projects\" ' or wherever you want to look for files
strFile = Dir(strPath, vbDirectory)
While strFile <> ""
strFilesFound = strFilesFound & strFile & vbCrLf
' get the next file and loop
strFile = Dir
Wend
ActiveDocument.Content.InsertAfter Text:=strFilesFound
End Sub