View Single Post
 
Old 12-17-2011, 06:29 AM
Joe Patrick Joe Patrick is offline Windows 7 64bit Office 2007
Advanced Beginner
 
Join Date: May 2011
Posts: 33
Joe Patrick is on a distinguished road
Default

Hi, Paul,

You're right, of course. Both those lines were removed after I pasted it in Word, I just accidentally left them in here. As you know, if those were the problems, I would have gotten more specific error messaging.

Here's the code I'm using. Thanx for taking a look!

Code:
Sub CreateNewFolder()
Dim _
fso As FileSystemObject, _
fol As Folder, _
fol_add As Folder, _
fil As File
Const strFolPath As String = "\\Fileserver\commonh\GROUP\SDF_data_export"
    Set fso = CreateObject("Scripting.FileSystemObject")
    Set fol = fso.GetFolder(strFolPath)
 
        If Not fso.FolderExists(strFolPath & "\" & ThisDocument.Textbox59.Value) Then
            Set fol_add = fso.CreateFolder(fol.Path & "\" & ThisDocument.Textbox59.Value)
        End If
 
    Set fso = Nothing
    Set fol = Nothing
 
End Sub
Reply With Quote