DSOle.dll problem with filename

  • Thread starter Thread starter Mark
  • Start date Start date
M

Mark

Hi,
I'm trying to use the DSOle.dll to read through all the
documents of a given directory and extract the custom
document properties from each document. When I run the
code listed below, I get a "Run-time error 432: File name
or class name not found during Automation operation". Can
anyone help me out? Thanks!

Mark

Sub GetFiles()
Dim rs As Recordset
Dim h As String
Dim oFilePropReader As DSOleFile.PropertyReader
Dim oDocProp As DSOleFile.DocumentProperties
Dim custdocprop As DSOleFile.CustomProperty

Set oFilePropReader = New DSOleFile.PropertyReader
h = Dir("S:\SupplyChain\CORPSERV\CONTRACT\Automation
Project\Change Orders\*.doc")

CurrentDb.Execute "Delete * From tblChangeOrders",
dbFailOnError
Set rs = CurrentDb.OpenRecordset("tblChangeOrders",
dbOpenDynaset)

Do While h <> vbNullString
If h <> "." Or h <> ".." Then
Set oDocProp =
oFilePropReader.GetDocumentProperties(h) <-ERROR HERE
' Debug.Print Err.Number, Err.Description
rs.AddNew
rs!ContractNumber = Left$(h, 6)
rs!ChangeOrder = Mid$(h, 8, 2)

For Each custdocprop In
oDocProp.CustomProperties
Select Case custdocprop.Name
Case "Start"
rs!StartDate = custdocprop.Value
Case "Internal"
rs!Internal = custdocprop.Value
Case "Executed"
rs!Executed = custdocprop.Value
Case "Complete"
rs!Complete = custdocprop.Value
Case "Notes"
rs!Notes = custdocprop.Value
Case Else
End Select
Next
rs.Update
h = Dir()
End If
Loop
ExitHere:
Set custdocprop = Nothing
Set oDocProp = Nothing
Set oFilePropReader = Nothing
Set rs = Nothing
DoCmd.OpenForm "Change Orders"
End Sub
 
Back
Top