It would help if you pasted the code that you have. However, the code that
you would need to create a folder with the name that is entered into
Textbox1 would be
MkDir "c:\" & Textbox1.text
As for getting the names of the folders, See the article "How to get the
names of all the folders in the folder tree, starting from a specified
folder" at:
http://www.word.mvps.org/FAQs/MacrosVBA/ReadFoldersIntoArray.htm

Signature
Hope this helps.
Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.
Doug Robbins - Word MVP
>I have a couple of problems I hope someone will be able to help with
>
[quoted text clipped - 27 lines]
>
> Pete
Pete - 02 Oct 2006 07:58 GMT
Hi Doug
Manyhtanks for the info, the code Im using for creating the folder, how
would your code fit in with this?
Private Sub CommandButton1_Click()
Dim fs, f, N
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.CreateFolder("c:\TextBox1.Value\")
Set f = Nothing
Set fs = Nothing
End Sub
Regards
Pete
Doug Robbins - Word MVP - 02 Oct 2006 18:47 GMT
Assuming that
Set f = fs.CreateFolder("c:\TextBox1.Value\")
does create a folder, to get it to create one under the root directory with
the name of the entry in TextBox1, you would use:
Set f = fs.CreateFolder("c:\" & TextBox1.Value)

Signature
Hope this helps.
Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.
Doug Robbins - Word MVP
> It would help if you pasted the code that you have. However, the code
> that you would need to create a folder with the name that is entered into
[quoted text clipped - 39 lines]
>>
>> Pete
Pete - 02 Oct 2006 21:22 GMT
Hi Doug
I have manged to get the code for running through folders to run
however I cant get the folders to be displayed in a list box ?
Regards
Pete
Doug Robbins - Word MVP - 03 Oct 2006 04:40 GMT
Replace the following code in the article to which I referred you:
For i = LBound(FoldersArray) To UBound(FoldersArray)
ActiveDocument.Range.InsertAfter FoldersArray(i) & vbCr
Next i
with
For i = LBound(FoldersArray) To UBound(FoldersArray)
[ListBox].AddItem FoldersArray(i)
Next i
replace [ListBox] with a proper reference to the listbox to which you want
to add the folders.

Signature
Hope this helps.
Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.
Doug Robbins - Word MVP
> Hi Doug
>
[quoted text clipped - 4 lines]
>
> Pete
Pete - 03 Oct 2006 16:15 GMT
Hi Doug
Sorry Im missing something here, I now have the following code
Dim FoldersArray As Variant
Dim i As Integer
'Read all subfolders of the specified folder into an array
'by calling the funcGetSubfolders function
FoldersArray = funcGetSubfolders("C:\Windows")
'Put the results (the array values) into the current document if it is
blank,
'or else into a new document
If Len(ActiveDocument.Range.Text) > 1 Then
Documents.Add
End If
For i = LBound(FoldersArray) To UBound(FoldersArray)
ListBox1.AddItem FoldersArray(i)
Next i
ActiveDocument.Saved = True
I have tried all varients of placing text within listbox1 code, form
intilize etc so must be doing something wrong?
Regards
Pete
Doug Robbins - Word MVP - 04 Oct 2006 04:50 GMT
The code would normally be in the Initialize() event of the form. This part
of the code is not required
'Put the results (the array values) into the current document if it is
blank,
'or else into a new document
If Len(ActiveDocument.Range.Text) > 1 Then
Documents.Add
End If

Signature
Hope this helps.
Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.
Doug Robbins - Word MVP
> Hi Doug
>
[quoted text clipped - 25 lines]
>
> Pete