Sub Sample()
    Dim FSO As New FileSystemObject
    Dim MyPath As String
    
    MyPath = CurrentProject.Path & "\sample2"

    If FSO.FileExists(MyPath & "\Sample.txt") Then
        MsgBox "ファイルが存在します"
    Else
        MsgBox "ファイルが存在しません"
        FSO.CreateTextFile MyPath & "\sample.txt"
    End If
    
    Set FSO = Nothing

End Sub

 ↓ facebook のフォローで応援してください。お願いします。



Microsoft Office ブログランキングへ