Quantcast
Channel: VBForums
Viewing all articles
Browse latest Browse all 15711

Folder path

$
0
0
Hi I am trying to get the path of the open folders, I found a way but it only works with the same project and I don't know what should I change for that.
help?
This code that is from this same forum but from another topic
Code:

Private Declare Function GetModuleFileNameW Lib "kernel32.dll" (ByVal hModule As Long, ByVal lpFileName As Long, ByVal nSize As Long) As Long

Private Function GetEXEName() As String
    Const MAX_PATH = 260&
    GetEXEName = Space$(MAX_PATH - 1&)
    GetEXEName = Left$(GetEXEName, GetModuleFileNameW(0&, StrPtr(GetEXEName), MAX_PATH))
    Text1 = GetEXEName
    'name   
    'GetEXEName = Right$(GetEXEName, Len(GetEXEName) - InStrRev(GetEXEName, "\"))
    'GetEXEName = Left$(GetEXEName, InStrRev(GetEXEName, ".") - 1)
    'Text2 = GetEXEName
End Function

Private Sub Form_Load()
    Call GetEXEName
End Sub

From here https://www.vbforums.com/showthread....B6-Application

Viewing all articles
Browse latest Browse all 15711

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>