Function EN Version 4.50

@CopyAttachment

Attachments Note

Syntax

@CopyAttachment(DBHANDLE1;DBHANDLE2;NOTEHANDLE3;NOTEHANDLE4;FN5);
@CopyAttachment(DBHANDLE1;DBHANDLE2;NOTEHANDLE3;NOTEHANDLE4;FNLIST5);
@CopyAttachment(DBHANDLE1;DBHANDLE2;NOTEHANDLE3;NOTEHANDLE4;TEXT5);
@CopyAttachment(DBHANDLE1;DBHANDLE2;NOTEHANDLE3;NOTEHANDLE4;TEXTLIST5);
@CopyAttachment(DBHANDLE1;DBHANDLE2;NOTEHANDLE3;NOTEHANDLE4;FN5;TEXT6);

Description

Copies attachments from the opened document with the NOTEHANDLE NOTEHANDLE3 of the database DBHANDLE DBHANDLE1 to the likewise opened document NOTEHANDLE NOTEHANDLE4 of the database DBHANDLE DBHANDLE2, without considering filename conflicts or allowing name changes. Therefore, this function is not suitable for merging multiple attachments from different documents!

Durch FN4/FNLIST5/TEXT5/TEXTLIST5 the attachments to be copied can be restricted by their position or by their name.

The return value of the function is a NUMBERLIST in which a 1 is set for each successfully copied attachment and a 0 for each error position.

Example: @CopyAttachment(DBHANDLE1;DBHANDLE2;NOTEHANDLE3;NOTEHANDLE4;TEXTLIST5);

ID:=8838;

dbh1:=@OpenDb("TEST.NSF");
noteh1:=@OpenNoteByID(dbh1;ID;noteh1);

names:=@AttachmentNames(noteh1);
orgnames:=@AttachmentInfo(noteh1;"FN");

noteh2:=@CreateNote(dbh1;noteh2);
Form[noteh2]:=Form[noteh1];

Ret:=@CopyAttachment(dbh1;dbh1;noteh1;noteh2;names);

STYLE1:=0:1:10:0:9;
STYLE2:=0:1:10:0:8;
RT[noteh2]:=@RTInit;
RT[noteh2]:=@RTAddText("File List Start"+@Newline;STYLE1;RT[noteh2]);
n2:=1;
n2e:=@Elements(names);
while(n2<=n2e)
{
   TEXT1:=@GetListElement(names;n2);
   TEXT2:=@GetListElement(orgnames;n2);
   RT[noteh2]:=@RTAddText(" File "+TEXT1+" -> ";STYLE2;RT[noteh2]);
   RT[noteh2]:=@RTAddFileIcon(TEXT1;TEXT2;"AnzeigeText:"+TEXT2;RT[noteh2]);
   RT[noteh2]:=@RTAddText(" <- "+@Newline;STYLE2;RT[noteh2]);
   @Increment(n2);
}
RT[noteh2]:=@RTAddText("File List End"+@Newline;STYLE1;RT[noteh2]);

noteh2:=@CloseNote(noteh2;1);
noteh1:=@CloseNote(noteh1;0);

dbh1:=@CloseDb(dbh1);

It is the document, with the NoteID 8838 (ist only a Example-value) in of the database with the namen "TEST.NSF" is opened.
A new document is then created in this database, and the file attachments of the first document are copied to the new document.
The form of the new document is also taken from the first document.
Im Feld RT of the new document receives a list of the attached files, with the file icons also integrated as references.

Note : This text was machine-translated and may contain inaccuracies.