Bom, tenta assim então...
Function GetLongFile(Filename As String)
Dim lPos As Long
lPos = InStrRev(Filename, ":")
If lPos > 0 Then
getlongfilepath = Mid(Filename, lPos - 1, 255)
getlongfilepath = Left(getlongfilepath, InStrRev(getlongfilepath, ".") + 3) 'modifiquei aqui
Else
getlongfilepath = ""
End If
GetLongFile = getlongfilepath
End Function
A função só falha ao tentar entrar com string tipo:
"HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionSharedDLLsC:Arquivos de programasMicrosoft OfficeOffice101046MSOHELP.EXE65¨.%1"
Onde o problema é o 2º ponto... (1º pto)->.EXE65¨(2ºpto)->.%1"
Mas mesmo com nome de pastas q contenham pto ela funciona, por exemplo
C:Arquivoswww.abc.comfile.exe,1*6
retorna assim:
C:Arquivoswww.abc.comfile.exe