Introduction
64 bit application cannot use DSOfile. So I have compiled DSOfile to x64 version and it can be used now in 64 bit application.
Background
The original DSOfile can be download from here.
Using the Code
- Download zip file (64.2 KB)
- Unzip the file.
- Run as Administrator Install.bat.
The script will copy dsofile_x64.dll to %WINDIR%\SysWOW64 and will register it. - Add reference to your project: "DSO OLE Document Properties Reader 2.1"
VBA example of using DSOfile
Private Function fnFileTitle(ByVal strFileName As String) As String
On Error GoTo OnError
Dim oOleDocProp
Set oOleDocProp = CreateObject("DSOFile.OleDocumentProperties")
oOleDocProp.Open (strFileName)
fnFileTitle = oOleDocProp.SummaryProperties.Title
oOleDocProp.Close
If Not oOleDocProp Is Nothing Then Set oOleDocProp = Nothing
Exit Function
OnError:
MsgBox Err.Number & " - " & Err.Description
Resume Next
End Function