Hi,
I want to find the root folder of where my drawing files are for are project..
We have prject folders in the following fashion..
Projects >> Client Name >> ProjectName... then in here, we have a Drawings folder and many other various folders including a Schedules folder where other dwgs are found..
Using the ThisDrawing.Path is there a way in VBA to backtrack folders so i can locate the main Project folder? So....
X:\Projects\MyClient\MyProject\Drawings\MyDrawing.dwg << obviously this is the dwg file
...but i want to find using vba the main project folder (X:\Projects\)
I didn't know if there was a fundamental vb function or command to remove the last few folders from a path string. I'm presuming it would involve looking for the '\' character in the string somehow but obviously there's a few in the path itself..
Any ideas?
Typical example. I have a small routine that opens Windows Explorer to the dwg file location, but i want it to open to the main project folder instead:
Sub open_project_window()
Dim RetVal
Dim dwg_path As String
dwg_path = ThisDrawing.Path
RetVal = Shell("C:\Windows\Explorer.exe " & dwg_path, 1)
End Sub