English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

how can I indicate the root direcotry in a file path description when writing a visual basic macro?

2007-05-10 12:39:49 · 2 answers · asked by Steven M 1 in Computers & Internet Programming & Design

2 answers

You can try using the tilda ~ to indicate the current path as

~/mySub/myProgram.exe
this would indicate to use the subdirectory from the current application path

Or you can use the application object and extract what path info you need. This code extracts the root of the current dirve based upon the application path string

Private Sub cmdDir_Click()
Dim appPath, appRoot As String
Dim ay() As String

appPath = Me.Application.Path
ay = Split(appPath, ":")
appRoot = ay(0) & ":\"

End Sub

2007-05-10 16:44:48 · answer #1 · answered by MarkG 7 · 0 1

you should use a function wich shows the root directory
get help from MSDN

2007-05-10 20:16:50 · answer #2 · answered by Anonymous · 0 1

fedest.com, questions and answers