
ReDim Preserve flNames(UBound(flNames) + 1)įlNames(UBound(flNames)) = Folder & vbTab & _ĪFile.Name & vbTab & aFile.Size & vbTab & aFile. Selection.ConvertToTable Separator:=wdSeparateByTabs, AutoFitBehavior:=wdAutoFitFixed "Size" & vbTab & "Creation Date" & vbCrLf Selection.TypeText "Path" & vbTab & "File name" & vbTab & _ Set FileSystem = CreateObject("Scripting.FileSystemObject") ' ***** This declaration must be at the top of the module ***** Word’s Sort can then be used to sort into any order. The results are put into a table in a new document. Other file information could be shown by changing the statement flNames(UBound(flNames)) = … The detail given for each file is the path, the name, the size and the creation date. The following macro will produce a list of all files in a folder and its sub-folders. The solution shown will give a list of files in a folder but not its sub folders. There are also third-party solutions available, such as Karen's Directory Printer, which was suggested by more than one subscriber: If you are looking for a more traditional way of getting the list using the command prompt or a macro, you should consider the WordTip located at this URL: For instance, you might want to select what was pasted and use Find and Replace to modify the path to each file, as desired. You can then edit the list in any way desired.
#How do i create a new folder on words full
What you end up with is the list of files-including full path names-in your document.

Context menu displayed when Shift+right-clicking on a group of files. While holding down the Shift key, right-click on one of the selected files.Everything in the folder should now be selected. Using File Explorer, navigate to the folder whose contents you want to list.
#How do i create a new folder on words windows
Windows immediately opens a File Explorer window. (This makes sure that your Word document is not active.)
