I know I’ve done this before, but for some reason it’s not working this time. I’m sure it must be something simple I’m overlooking. Please assist.
Trying to detach files from selected documents in a view to a local drive. This script is behind a view action button:
Dim s As New NotesSession
Dim db As NotesDatabase
Dim coll As notesdocumentcollection
Dim doc As NotesDocument
Dim rtitem As Variant
Set db = s.CurrentDatabase
Set coll = db.UnprocessedDocuments
For j = 1 To coll.Count
Set doc = coll.GetNthDocument(j)
Set rtitem = doc.GetFirstItem( “PrintDocument” )
If ( rtitem.Type = RICHTEXT ) Then
Forall o In rtitem.EmbeddedObjects
If ( o.Type = EMBED_ATTACHMENT ) Then
filepath$ = "C:\Forms\" & doc.GetFirstItem("Category").text & "\" & o.Name()
Call o.ExtractFile (filepath$)
End If
End Forall
End If
Next
The error I get is Notes Error: File Cannot Be Created (file path and name are displayed here)
Any help will be greatly appreciated.
Thanks!