help with vb macro for word

  [DELETED] 12:59 29 Nov 2003
Locked

Hi, i have the following code that lists all 'mpg' files in a folder. Is it possible to tweak it so that it also displays the file size next to each file?

cheers.

Sub ListDocNamesInFolder()
Dim sMyDir As String
Dim sDocName As String

' The path to obtain files.
sMyDir = "C:\Documents and Settings\Steve Allen\My Documents\My Videos\Converted files\various\"
sDocName = Dir(sMyDir & "*.mpg")

' Add new document.
Documents.Add

' Insert folder name and file names in document.
Selection.TypeText "Documents in folder " & sMyDir & vbCr & vbCr
While sDocName > ""
' Insert filename in document.
Selection.TypeText sDocName & vbCr
' Get next file name.
sDocName = Dir()
Wend
End Sub

  [DELETED] 16:49 29 Nov 2003

... all the vb experts gone :-(

This thread is now locked and can not be replied to.

Elsewhere on IDG sites

How to watch the World Cup for free on TV and online

Meet Superfiction, the little design studio with a load of character

Best Mac buying guide 2018

Comment résoudre les problèmes de connexion internet d’un iPhone ?