你把返回路径的那个字符串换成你的不就可以了

解决方案 »

  1.   

    没问题,只要文件夹有就可以了。
      

  2.   

    那个字符串本来就是我定义的
    可是这样好象调试不通
      

  3.   

    如果文件夹下存在的话可以先创建这个文件夹
    用以下方法测试文件(夹)是否存在
    用FileSystemObject对象可以测试一个文件(夹)是否存在:
    在“工程”中“引用”-》“Microsoft Scripting Runtime”
    以下为测试文件(夹)是否存在的函数:
    Function FileExists(strPath as string,Optional blnFolder As Boolean=False) As Boolean
    'strPath:要测试的文件(夹)
    'blnFolder:确认是否测试内容(True:测试文件夹False:测试文件(False为默认值))
    On Error Resume Next
    If Trim$(strPath)="" Then '如果参数为空
    FileExists = False
    Else
    Dim Fso As New FileSystemObject
    If blnFolder Then '如果是测试文件夹是否存在
    FileExists = Fso.FolderExists(strPath)
    Else
    FileExists = Fso.FileExists(strPath)
    End If
    End If
    End Function
    函数返回值:True:存在,False:不存在