Results 1 to 4 of 4

Thread: [RESOLVED] Printing file names

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Aug 2005
    Location
    Up State NY
    Posts
    525

    Resolved [RESOLVED] Printing file names

    Using Drive,Dir and File I can tunnel down to the files I want. I need to be able to print out all the names of the files with in the folder as they are displayed on the FILE1 control, at the click of a button.

    Any ideas guys?

  2. #2
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390

    Re: Printing file names

    VB Code:
    1. Private Sub Command1_Click()
    2.     Dim x As Integer
    3.     For x = 0 To File1.ListCount - 1
    4.         Printer.Print File1.List(x)
    5.     Next
    6.     Printer.EndDoc
    7. End Sub
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

  3. #3
    Just Married shakti5385's Avatar
    Join Date
    Mar 2006
    Location
    Udaipur,Rajasthan(INDIA)
    Posts
    3,747

    Re: Printing file names

    VB Code:
    1. Dim FileName1
    2. Private Sub Form_Load()
    3. 'FileName1 = App.Path & "\SoftwareFiles" 'You Can use ur Path
    4. Set Fs = CreateObject("Scripting.FileSystemObject")
    5. Set Fs = New FileSystemObject
    6. FileName1 = "C:\Program Files\Address Book\Image" 'Image is folder Name In Address Book Folder
    7. Set f = Fs.GetFolder(FileName1)
    8. Set fc = f.Files
    9. For Each f1 In fc
    10. s1 = s1 & f1.Name
    11. MsgBox s1
    12. Next
    13. End Sub

  4. #4

    Thread Starter
    Fanatic Member
    Join Date
    Aug 2005
    Location
    Up State NY
    Posts
    525

    Re: Printing file names

    Perfect! Thanks!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width