Short Path files

I would like to use this solution but as I am not an expert and was not able to search and find a solution could you please post all the code I would need ? I am just using

Private Sub View_Photo_Click()
FollowHyperlink Me.Text25
End Sub

What code do i need to replace this? I am using Msaccess 2021 build 16 64 bit
Perhaps give your controls meaningful names?
Text25 is not going to mean anything to anyone a few weeks down the line.
 
I would like to use this solution but as I am not an expert and was not able to search and find a solution could you please post all the code I would need ? I am just using

Private Sub View_Photo_Click()
FollowHyperlink Me.Text25
End Sub

What code do i need to replace this? I am using Msaccess 2021 build 16 64 bit
i tried the following and it works but if the path is a "normal" lenght path i get 2 pop ups (pictures in my case) but when used against a "long" lenght path I get just the 1 popup, which is what I want. Any ideas why

Dim strpath As String
strpath = Text25
Shell "explorer.exe " & strpath
CreateObject("Shell.Application").NameSpace(0).ParseName(strpath).InvokeVerb "Open"
 
you remove the Shell .. part.

Code:
Dim strpath As String
strpath = Text25
CreateObject("Shell.Application").NameSpace(0).ParseName(strpath).InvokeVerb "Open"
 
Sub foo() Dim fso As Object, fsofile As Object, strShortName As String Dim fsofolder As Object Set fso = CreateObject("scripting.filesystemobject") Set fsofolder = fso.getfolder("C:\Users\Isaac \Desktop\Bills") For Each fsofile In fsofolder.Files MsgBox fsofile.shortpath Next fsofile End Sub
@Isaac
Thanks for that code. I'd forgotten about ShortPath being available from FSO
 
Thanks all, very useful information in all of the thread. The code "shell aplication" works great! However I will speak to the users as some of their directory names and file names are out of control (i.e Collecties\Museum algemeen\Archief\Tentoonstellingen en presentaties\Wisseltentoonstellingen\2024 Tentoonstelling Mensen maken het verschil\Indeling onderwerpen 2024\6 CTT conducteurs tram\)

More knowledge and experience everyday! - Andy
 

Users who are viewing this thread

Back
Top Bottom