Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 05-18-2016, 08:04 PM
BobKnepper BobKnepper is offline How capture a folder's file names to a file? Windows XP How capture a folder's file names to a file? Office 2010 32bit
Novice
How capture a folder's file names to a file?
 
Join Date: Apr 2013
Location: Anaheim, CA
Posts: 7
BobKnepper is on a distinguished road
Default How capture a folder's file names to a file?

Want to prepare an index file of a folder's file names. MS Word 2010. Faint memory of doing this but can't remember steps. Thanks for help.

Bob

Last edited by Charles Kenyon; 05-19-2016 at 09:14 AM. Reason: Mark as solved
Reply With Quote
  #2  
Old 05-18-2016, 08:32 PM
gmayor's Avatar
gmayor gmayor is offline How capture a folder's file names to a file? Windows 10 How capture a folder's file names to a file? Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,101
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

Perhaps the simplest solution is the Printfolders utility which you can download from my web site - http://www.gmayor.com/downloads.htm

Alternatively you could use a macro. The following is the most basic
Code:
Option Explicit

Sub ListFiles()
Dim strFile As String
Const strPath As String = "C:\Path\" 'The folder to process
Dim strList As String
    strFile = Dir$(strPath & "*.*")
    While strFile <> ""
        strList = strList & strFile & vbCr
        strFile = Dir$()
    Wend
    strList = Left(strList, Len(strList) - 1)
    Selection.Text = strList
lbl_Exit:
    Exit Sub
End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
  #3  
Old 05-22-2016, 07:30 AM
BobKnepper BobKnepper is offline How capture a folder's file names to a file? Windows XP How capture a folder's file names to a file? Office 2010 32bit
Novice
How capture a folder's file names to a file?
 
Join Date: Apr 2013
Location: Anaheim, CA
Posts: 7
BobKnepper is on a distinguished road
Default List File Names

Thank you, Graham, for your answers.

I will probably be back for more help on similar problems. Am long time casual user of Word - not enough use to become "expert".
Reply With Quote
Reply

Tags
index



Similar Threads
Thread Thread Starter Forum Replies Last Post
How capture a folder's file names to a file? Copy and Paste from File to File but File Names always change aaronbauer1980 Excel Programming 1 04-15-2016 05:53 PM
How capture a folder's file names to a file? Automated file names Gary Drumm Word 3 04-17-2013 11:30 AM
Add text to all file names in folder cure4glass Office 3 04-06-2012 04:23 PM
capture sender's contact to 'Contacts Folder' gianimpact Outlook 0 02-09-2010 07:56 AM
Two Different Names in the Same File kathy carson Outlook 0 02-14-2006 01:02 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 11:37 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft