投稿日 | : 2005/04/17(Sun) 22:45 |
投稿者 | : 花ちゃん |
Eメール | : |
URL | : |
タイトル | : Re^3: フォルダの指定について |
Option Explicit
Private DataFile As String
Private Sub Form_Load()
DataFile = fMyPath & "testo.txt"
Debug.Print DataFile
End Sub
Private Function fMyPath() As String
'プログラム終了まで MyPath の内容を保持
Static MyPath As String
'途中でディレクトリ-が変更されても起動ディレクトリ-を確保
If Len(MyPath) = 0& Then
MyPath = App.Path 'ディレクトリ-を取得
'ルートディレクトリーかの判断
If Right$(MyPath, 1&) <> "\" Then
MyPath = MyPath & "\"
End If
End If
fMyPath = MyPath
End Function