How can I copy a file attach from a document to other?
Thanks for your help.
How can I copy a file attach from a document to other?
Thanks for your help.
Subject: copy attachments
hi, not sure what you want to do, but usually a regular foward will include the attached file.
if you only want to have the file,
try manipulating the file object:
here is an example where my function extract a file to a specific path:
Sub extractObjects
Dim chkfolder As String
'Dim chkfile As String
chkfolder$ = Dir$(dbProfile.extracttx(0),16)
'chkfile$ = Dir$(dbProfile.extracttx(0) & "\" & o.Source,0)
On Error Goto ErrorHandler
If mtrDoc.HasEmbedded Then
Set mtrItem = mtrDoc.Getfirstitem("Body")
If Not mtrItem Is Nothing Then
Forall o In mtrItem.EmbeddedObjects
If ( o.Type = EMBED_ATTACHMENT ) Then
'check if path specified in profile doc exist, if not, create the folder
If (chkfolder$ <> "") Then
'check if file already exists, if yes, increment by 1 filename
'If chkfile$ <> "" Then
pathname=dbProfile.extracttx(0)& "\" & o.Source
Call o.ExtractFile(pathname)
'Else
'End If
Else
Mkdir (dbProfile.extracttx(0))
pathname=dbProfile.extracttx(0) & "\" & o.Source
Call o.ExtractFile(pathname)
End If
End If
End Forall
End If
End If
SingleExit:
Exit Sub
ErrorHandler:
Call ProcessError( _
dbProfile.dbsendto(0), _
"Error in agProcessMTRls agent", _
"Extract objects", _
mtrDoc)
End Sub
Subject: copy attachments
Hi,
I usually use
NotesDocument.CopyToDatabase()
to copy a document with attachments. Than I remove or change the fields of that document to whatever I want.
Best regards
Mario Varchmin
http://www.e-llennium.com/e-llennium/index_en.htm