AW: VBA GetDetailsOf - Fragezeichen in Daten
07.10.2024 10:12:44
volti
Hallo,
die Fragezeichen sind keine Fragezeichen sondern das Zeichen 0 (CHR$(0))
Kann man auch mit einem HEX-Editor nachsehen. Mit diesem z.B.
https://www.clever-excel-forum.de/Thread-HEX-Editor
In meinem Fototool habe ich das einfach so gelöst, kann man sicher auch mit Replace machen...
https://www.clever-excel-forum.de/Thread-Foto-und-Medienmanager
Nur ein Ausschnitt.....
Code:
Private Function GetFileDetails(sPath As String, sFile As String) As String
' Funktion ermittelt einige Datei-Parameter und bereinigt sie um unnötige Zeichen
Dim oFile As Object, i As Integer
With CreateObject("Shell.Application").Namespace(CVar(sPath))
Set oFile = .ParseName(sFile)
' 32 Firma, 30=Kamera-Typ, 31=Auflösung, 12 Aufnahmedatum
' 11 Video/Musik, 16 Intepret, 27 Länge, 165/194 Titel, 169 Datei-Typ
msFirma = .getdetailsof(oFile, 32) ' Hersteller
msKamera = .getdetailsof(oFile, 30) ' Kameratyp
msTyp = .getdetailsof(oFile, 11) ' Typ: Video, Musik, Foto
msTitel = .getdetailsof(oFile, 21) ' Titel des Songs
msZeit = .getdetailsof(oFile, 27) ' Länge des Songs
msDatTyp = .getdetailsof(oFile, 194) ' Länge des Songs
If msKamera <> "" Then
If Not msKamera Like Split(msFirma)(0) & "*" Then _
msKamera = msFirma & " " & msKamera
End If
msPixel = .getdetailsof(oFile, 31) ' Auflösung
msHochBreit = .getdetailsof(oFile, 316) & " x " & .getdetailsof(oFile, 314)
msDatenrate = .getdetailsof(oFile, 313) & ", " & .getdetailsof(oFile, 315)
msBitrate = .getdetailsof(oFile, 28)
If Len(msPixel) > 2 Then msPixel = Mid$(msPixel, 2, Len(msPixel) - 2)
GetFileDetails = .getdetailsof(oFile, 12) ' Aufnahmedatum zurückgeben
msAufnahmedatum = ""
For i = 2 To Len(GetFileDetails)
If Mid$(GetFileDetails, i, 1) <> Chr$(0) Then _
msAufnahmedatum = msAufnahmedatum & Mid$(GetFileDetails, i, 1)
Next i
End With
End Function
_________________________
viele Grüße aus Freigericht 😊
Karl-Heinz