Im running the following function to obtain the pixel size of jpg files. The answer is being returned in the form of ?3648 x 2736?. I'm trying to strip out the "?", but failing with Substitute. I can use Left/Right, but it's a bit messy. Any suggestions?
[VBA]Sub Testing()
MsgBox fnGetDetailsOfVB("C:\Pics", "Photo.jpg")
End Sub
Function fnGetDetailsOfVB(pth, fil)
Dim objShell
Dim objFolder
Dim objFolderItem
Dim objInfo
Set objShell = CreateObject("shell.application")
Set objFolder = objShell.Namespace(pth & "\")
If (Not objFolder Is Nothing) Then
Set objFolderItem = objFolder.ParseName(fil)
If (Not objFolderItem Is Nothing) Then
objInfo = objFolder.GetDetailsOf(objFolderItem, 31)
End If
Set objFolderItem = Nothing
End If
fnGetDetailsOfVB = objInfo
Set objFolder = Nothing
Set objShell = Nothing
End Function
[/VBA]