Find documents attachment using Lotus Script

I am building a program to grab all documents from a specific view and if the document contains an attachment, I want to save it to a place i’ve specified.

I am pretty sure i know how to make the file structure and save the documents once i have them. My problem seems to lie in grabbing the actual attachment.

The attachment isn’t held in a richtext field, it was uploaded to the document using a fileupload control. Does anyone know of a way to grab the attachment?

Thanks,

Smitty

Subject: Find documents attachment using Lotus Script

Here’s an excerpt from the Lotus Notes Knowledgebase which demonstrates how to get a handle to attachments not contained within rich text fields.

Alex


Dim doc As NotesDocument

Dim item As Variant

Dim nitem as Variant

Dim rtitem as Variant

Forall i In doc.Items

 If i.type = Attachment Then

Set nitem = doc.GetFirstItem(i.name)

Set emb = doc.GetAttachment(i.values(0))

    Call emb.extractfile("C:\" & emb.name) 

 End If

End Forall

Subject: RE: Find documents attachment using Lotus Script

Thanks a million!

Could you tell me how/where you found that? I looked through help, on these forums, and google, and couldn’t seem to find anything

Subject: RE: Find documents attachment using Lotus Script

I can’t tell you…I’d have to kill you then. :wink:

Seriously though I found it in the Lotus Notes Knowledge Base which you can access on the web at:

Alex