FileSystemObject questions

Results 1 to 2 of 2

Thread: FileSystemObject questions

  1. #1
    Join Date
    Dec 1969

    Default FileSystemObject questions

    Here&#039;s the short:<BR><BR>I want to dynamically create links to a set of images in a specified directory. The content in the directory changes rather frequently, but I still want to create an automatic link to the images. <BR><BR>How can I use FileSystemObject objects to find and link to my images? I know I can loop through like this:<BR>For Each f1 in files<BR> {code for link, using f1 as the filename}<BR>Next<BR><BR>But that links to all images, and I want to pull files ordinally. For example: I want to create links to the third, fourth, and fifth images in a given directory. Without putting a condition on my loop, is there a way to get a file ordinally, rather than by name? I&#039;ve done this with recordsets, but these images are not kept in a database.

  2. #2
    Join Date
    Dec 1969

    Default You can request them ordinally...

    ...use the .Files collection of the Folder object:<BR><BR>&#060;%<BR><BR>Dim fil1, fil2<BR>fil1 = objFolder.Files.Item(0)<BR>fil2 = objFolder.Files.Item(6)<BR><BR>%&#062;<BR><BR>Howe ver, be careful. I&#039;ve never figured out what order the files come back in. Some people say it&#039;s alphabetic, some people say they have found it sometimes not come back alphabetic. You may want to investigate it yourself before you head down the (less-flexible) ordinal route.<BR><BR>Craig.

Posting Permissions

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