Exporting attached files from a Notes Forms database

Hello,

Does anyone have any code or examples of how I would export documents from a Note database. The database is written on a form which have Word documents as attachments. I need to export the word documents into a text file.

It is acceptable to export it has a word document.

Please reply email to whitenr@saic.com or

tawhip@aol.com

Thanks,

Ray

Subject: Exporting attached files from a Notes Forms database

Ray,

I’ve mailed this to you also, but I’ve posted it here in case others may want the same answer… This will extract the file to the hard drive - I assume this will meet your minimum requirement. To get the plain text out of the word doc, you could open Word as a COM object, open the file and then SaveAs a text file. However, I’m not sure how to do it. I create Excel spreadsheets with COM using a template file and then shoot them out to the user, so it can’t be too much different.

R/s,

Charlie

'—Get the current data drive and directory dynamically from the Session

sFilePath = session.GetEnvironmentString( “Directory”, True )

'—Loop thru the items instead of going for them by name - this allows

'—us to pick up file attachments regardless of what they may be named

Forall x In doc.Items

'—Must be an attachment!

If x.Type = 1084 Then

'—Grab the attachment and extract to the data drive

Set embedded = doc.GetAttachment(x.Values(0))

Call embedded.ExtractFile(sFilePath & {\attachments} & x.Values(0))

End If

End Forall