Importing Attachment

Hello,

I’ve managed to import data from an old Access database using a delimited text file. My next problem is that I need to import the attachments for each record, I can make it so that the location of the file writes itself into a Notes Rich text field, is there anyway of getting notes to look at that location and get the file?

Regards,

Richard Low

Subject: Importing Attachment

Here is code I received from this site while trying to attach pdf files, not sure if it is what you are looking for, but it worked great!

'Attach PDFs

Sub Click(Source As Button)

Dim session As New NotesSession

Dim db As NotesDatabase

Dim doc As NotesDocument

Dim rtitem As NotesRichTextItem

Dim object As NotesEmbeddedObject

Dim pathName As String, fileName As String

Dim filesToGet As String, filePathName As String



pathName$ = "S:\IS\Report_Export_Test\Endow_to_lotus\Broken\07\FinishedSentTo_07\"

filesToGet$ = pathName$ + "*.pdf"

fileName$ = Dir$(filesToGet$, 0 )



Set db = session.CurrentDatabase



Do While fileName$ <> "" 

	Set doc = New NotesDocument( db )

	Set rtitem = New NotesRichTextItem( doc, "pdf" ) 'in quotes = attachment field name

	filePathName$ = pathName$ + fileName$

	Set object = rtitem.EmbedObject(EMBED_ATTACHMENT, "", filePathName$) 

	doc.Form = "recippdf07"

	doc.fy = 2007		

	doc.fullbudget = fileName$

	Call doc.Save( True, True )

	fileName$ = Dir$( )

Loop

End Sub

Subject: RE: Importing Attachment

Thanks, I’ve managed to import the files