nsdhakar

Access multiple folders simultaneously (VBA)

Discussion created by nsdhakar on Nov 8, 2011
Latest reply on Nov 10, 2011 by twhiteaker
Hi,
I have a loop that adds two layers in every step, and both layers are from different folders. That means that the loop involves going through two different folders simultaneously. I know how to loop through one folder but don't know how to do it for multiple folders.

Following is what I want to do:

inputfile1 = Dir(folder1 + "*.shp")
inputfile2 = Dir(folder2+"*.shp")

do while inputfile1 <> ""
  ' Add inputfile1 and inputfile2 to map

  ' go to next files in respective folders
  inputfile1=Dir
  inputfile2=Dir
Loop


Thanks,

Nagendra

Outcomes