Hi,
Would anybody be able to tell me how to concatenate the contents of a for loop together adding each return value to the last. For example I have a string
I use split(cInsDir, "\") to break it down. I need the output to be:
C:\fldr1
C:\fldr1\fldr2
C:\fldr1\fldr2\fldr3 etc...
The code below returns:
C:
fldr1
fldr2
fldr3
Perhaps I should be using a while loop instead of a for loop??
At this point, the path doesn't actually exist so I can't use fileSystemObject methods and as this script sets a file on a server, the script doesn't have access to the client.
TIA
Woter
Would anybody be able to tell me how to concatenate the contents of a for loop together adding each return value to the last. For example I have a string
Code:
cInsDir = "C:\fldr1\fldr2\fldr3"
C:\fldr1
C:\fldr1\fldr2
C:\fldr1\fldr2\fldr3 etc...
The code below returns:
C:
fldr1
fldr2
fldr3
Code:
Set dict = CreateObject("Scripting.Dictionary")
Dim aryW, i, str, k
aryW = Split(cInsDir,"\")
k = 1
For i = 0 To UBound(aryW)
str = aryW(i)
k = k +1
dict.Add k, str
MsgBox dict.Item(k)
Next
Perhaps I should be using a while loop instead of a for loop??
At this point, the path doesn't actually exist so I can't use fileSystemObject methods and as this script sets a file on a server, the script doesn't have access to the client.
TIA
Woter