@ExtractOSFileFromNote
Syntax
@ExtractOSFileFromNote(NOTEHANDLE1;OPTIONS1;SINCE1;TEXT1;TEXT2);
@ExtractOSFileFromNote(NOTEHANDLE1;OPTIONS1;SINCE1;TEXTLIST1;TEXT2);
@ExtractOSFileFromNote(NOTEHANDLE1;OPTIONS1;SINCE1;FN1;TEXT2);
@ExtractOSFileFromNote(NOTEHANDLE1;OPTIONS1;SINCE1;FNLIST1;TEXT2);
@ExtractOSFileFromNote(NOTEHANDLE1;OPTIONS1;SINCE1;TEXTLIST1;TEXTLIST2);
@ExtractOSFileFromNote(NOTEHANDLE1;OPTIONS1;SINCE1;FNLIST1;TEXTLIST2);
Description
Copies one or more file attachments, whose names or positions (see @AttachmentInfo) in TEXT/TEXTLIST/FN/FNLIST TEXT1/TEXTLIST1/FN1/FNLIST1 are specified, from the document with the NOTEHANDLE NOTEHANDLE1 as files to a drive or to OSPath.
The @Function returns a NUMBERLIST in which the elements corresponding to the list of file attachments to be extracted (TEXT1/TEXTLIST1/FN1/FNLIST1) are set to 1 if the file attachment could be created as a file, or to 0 if it could not be created.
The TEXT OPTIONS1 specifies whether the TEXT/TEXTLIST TEXT2/TEXTLIST2 as a path ("P") for all files or as a file name ("F") for the corresponding element of the fourth parameter of the @Function.
It can also be specified whether existing files should be overwritten ("O") and whether non-existing directories should be created ("D").
The options can be combined (e.g. "POD" (Path/Overwrite/Directory Create or "FO" File/Overwrite).
OPTIONS1:
P=Path
F=File
O=Overwrite
D=Directory create
TD SINCE1 can be used to specify a time value from which file creation time onward a file attachment is to be extracted.
If a file is to be extracted regardless of this, the time value returned by @AnyAllDay must be used.
SINCE1 cannot be a time alone, but must include a date
(That is, not [10:30:50], but [10.10.92 10:30:50] or [10.10.92]).
TEXT1/TEXTLIST1:
name(s) of the attached file(s) to be extracted.
FN1/FNLIST1:
Position(s) of the attached file(s) to be extracted in the attachment list.
TEXT2/TEXTLIST2:
For option P:
OSPath to which the files are to be written.
For option F:
File names that the extracted files should have on disk.
Example: @ExtractOSFileFromNote(NOTEHANDLE1;OPTIONS1;SINCE1;TEXT1;TEXT2)
DBHANDLE1:=@OpenDB("TEST.NSF");
VIEWHANDLE1:=@OpenView(DBHANDLE1;"TEST VIEW");
VIEWPOSITION1:=1:1:1:0:0:0:0:0:0:0;
NOTEHANDLE1:=@OpenNoteByPosition(DBHANDLE1;VIEWHANDLE1;VIEWPOSITION1;NOTEHANDLE1);
SINCE1:=@AnyAllDay;
OPTIONS1:="FOD";
TEXT1:="Attach1.TST";
TEXT2:="C:\\TEST\\FILE1.TST";
AttRetList:=@ExtractOSFileFromNote(NOTEHANDLE1;OPTIONS1;SINCE1;TEXT1;TEXT2);
NOTEHANDLE1:=@CloseNote(NOTEHANDLE1;0);
VIEWHANDLE1:=@CloseView(VIEWHANDLE1);
DBHANDLE1:=@CloseDB(DBHANDLE1);
If possible, the file attachment with the name "Attach1.TST" is created from the document with the NOTEHANDLE NOTEHANDLE1 as file "C:\\TEST\\FILE1.TST" created.
If the file "C:\\TEST\\FILE1.TST" could be created, AttRetList contains 1; otherwise, it contains 0.
The file creation date was not considered (SINCE1:=@AnyAllDay).
The OPTIONS1 ("FOD") have the following meaning here:
TEXT2 is treated as the file name; to existing file with the same name would be overwritten, and if a directory C:\TEST did not exist, it would be created.
Example: @ExtractOSFileFromNote(NOTEHANDLE1;OPTIONS1;SINCE1;FN1;TEXT2)
DBHANDLE1:=@OpenDB("TEST.NSF");
VIEWHANDLE1:=@OpenView(DBHANDLE1;"TEST VIEW");
VIEWPOSITION1:=1:1:1:0:0:0:0:0:0:0;
NOTEHANDLE1:=@OpenNoteByPosition(DBHANDLE1;VIEWHANDLE1;VIEWPOSITION1;NOTEHANDLE1);
SINCE1:=@AnyAllDay;
OPTIONS1:="FOD";
FN1:=1;
TEXT2:="C:\\TEST\\FILE1.TST";
AttRetList:=@ExtractOSFileFromNote(NOTEHANDLE1;OPTIONS1;SINCE1;FN1;TEXT2);
NOTEHANDLE1:=@CloseNote(NOTEHANDLE1;0);
VIEWHANDLE1:=@CloseView(VIEWHANDLE1);
DBHANDLE1:=@CloseDB(DBHANDLE1);
If possible, the file attachment at position 1 in the Attachment-List is created from the document with the NOTEHANDLE NOTEHANDLE1 as file "C:\\TEST\\FILE1.TST" created.
If the file "C:\\TEST\\FILE1.TST" could be created, AttRetList contains 1; otherwise, it contains 0.
The file creation date was not considered (SINCE1:=@AnyAllDay).
The OPTIONS1 ("FOD") have the following meaning here:
TEXT2 is treated as the file name; to existing file with the same name would be overwritten, and if a directory C:\TEST did not exist, it would be created.
Example: @ExtractOSFileFromNote(NOTEHANDLE1;OPTIONS1;SINCE1;TEXTLIST1;TEXT2)
DBHANDLE1:=@OpenDB("TEST.NSF");
VIEWHANDLE1:=@OpenView(DBHANDLE1;"TEST VIEW");
VIEWPOSITION1:=1:1:1:0:0:0:0:0:0:0;
NOTEHANDLE1:=@OpenNoteByPosition(DBHANDLE1;VIEWHANDLE1;VIEWPOSITION1;NOTEHANDLE1);
SINCE1:=@AnyAllDay;
OPTIONS1:="POD";
TEXTLIST1:="Attach1.TST":"Attach2.TST":"Attach3.TST";
TEXT2:="C:\\TEST";
AttRetList:=@ExtractDetachOSFileFromNote(NOTEHANDLE1;OPTIONS1;SINCE1;TEXTLIST1;TEXT2);
NOTEHANDLE1:=@CloseNote(NOTEHANDLE1;0);
VIEWHANDLE1:=@CloseView(VIEWHANDLE1);
DBHANDLE1:=@CloseDB(DBHANDLE1);
If possible, the file attachments with the name "Attach1.TST","Attach2.TST" and "Attach3.TST" are created from the document with the NOTEHANDLE NOTEHANDLE1 as files "C:\\TEST\\Attach1.TST","C:\\TEST\\Attach2.TST" and "C:\\TEST\\Attach3.TST" created.
If the files could be created, AttRetList contains 1:1:1; otherwise, it contains 0:0:0.
If, for example, only the file "C:\\TEST\\Attach2.TST" could not be created (while the others could), AttRetList would contain 1:0:1.
The file creation date was not considered (SINCE1:=@AnyAllDay).
The OPTIONS1 ("POD") have the following meaning here:
TEXT2 is treated as OSPath; existing files with the same names would be overwritten, and if a directory C:\TEST did not exist, it would be created.
Example: @ExtractOSFileFromNote(NOTEHANDLE1;OPTIONS1;SINCE1;FNLIST1;TEXT2)
DBHANDLE1:=@OpenDB("TEST.NSF");
VIEWHANDLE1:=@OpenView(DBHANDLE1;"TEST VIEW");
VIEWPOSITION1:=1:1:1:0:0:0:0:0:0:0;
NOTEHANDLE1:=@OpenNoteByPosition(DBHANDLE1;VIEWHANDLE1;VIEWPOSITION1;NOTEHANDLE1);
SINCE1:=@AnyAllDay;
OPTIONS1:="POD";
FNLIST1:=1:4:5;
TEXT2:="C:\\TEST\\FILE1.TST";
AttRetList:=@ExtractDetachOSFileFromNote(NOTEHANDLE1;OPTIONS1;SINCE1;FNLIST1;TEXT2);
NOTEHANDLE1:=@CloseNote(NOTEHANDLE1;0);
VIEWHANDLE1:=@CloseView(VIEWHANDLE1);
DBHANDLE1:=@CloseDB(DBHANDLE1);
If possible, the file attachments at positions 1,4 and 5 in the Attachment-List are created from the document with the NOTEHANDLE NOTEHANDLE1 as files with the jeweiligen Attachment-names in the directory "C:\\TEST" created.
If the files could be created, AttRetList contains 1:1:1; otherwise, it contains 0:0:0.
If, for example, only the file with the Position 5 could not be created (while the others could), AttRetList would contain 1:1:0.
The file creation date was not considered (SINCE1:=@AnyAllDay).
The OPTIONS1 ("POD") have the following meaning here:
TEXT2 is treated as OSPath; existing files with the same names would be overwritten, and if a directory C:\TEST did not exist, it would be created.
Example: @ExtractOSFileFromNote(NOTEHANDLE1;OPTIONS1;SINCE1;TEXTLIST1;TEXTLIST2)
DBHANDLE1:=@OpenDB("TEST.NSF");
VIEWHANDLE1:=@OpenView(DBHANDLE1;"TEST VIEW");
VIEWPOSITION1:=1:1:1:0:0:0:0:0:0:0;
NOTEHANDLE1:=@OpenNoteByPosition(DBHANDLE1;VIEWHANDLE1;VIEWPOSITION1;NOTEHANDLE1);
SINCE1:=@AnyAllDay;
OPTIONS1:="FD";
TEXTLIST1:="Attach1.TST":"Attach2.TST":"Attach3.TST";
TEXTLIST2:="C:\\TEST\\FILE1.TST":"C:\\TEST\\FILE2.TST":"C:\\TEST\\FILE3.TST";
AttRetList:=@ExtractDetachOSFileFromNote(NOTEHANDLE1;OPTIONS1;SINCE1;TEXTLIST1;TEXTLIST2);
NOTEHANDLE1:=@CloseNote(NOTEHANDLE1;0);
VIEWHANDLE1:=@CloseView(VIEWHANDLE1);
DBHANDLE1:=@CloseDB(DBHANDLE1);
If possible, the file attachments with the name "Attach1.TST","Attach2.TST" and "Attach3.TST" are created from the document with the NOTEHANDLE NOTEHANDLE1 as files "C:\\TEST\\FILE1.TST","C:\\TEST\\FILE2.TST" and "C:\\TEST\\FILE3.TST" created.
If the files could be created, AttRetList contains 1:1:1; otherwise, it contains 0:0:0.
If, for example, only the file "C:\\TEST\\FILE2.TST" could not be created (while the others could), AttRetList would contain 1:0:1.
The file creation date was not considered (SINCE1:=@AnyAllDay).
The OPTIONS1 ("FD") mean hier:
TEXTLIST2 is treated as a file-name list; existing files with the same names would not be overwritten (the file could not be created -> also 0 in the AttRetList) and should a directory C:\TEST does not exist, it would be created.
Example: @ExtractOSFileFromNote(NOTEHANDLE1;OPTIONS1;SINCE1;FNLIST1;TEXTLIST2)
DBHANDLE1:=@OpenDB("TEST.NSF");
VIEWHANDLE1:=@OpenView(DBHANDLE1;"TEST VIEW");
VIEWPOSITION1:=1:1:1:0:0:0:0:0:0:0;
NOTEHANDLE1:=@OpenNoteByPosition(DBHANDLE1;VIEWHANDLE1;VIEWPOSITION1;NOTEHANDLE1);
SINCE1:=@AnyAllDay;
OPTIONS1:="FOD";
FNLIST1:=1:4:5;
TEXTLIST2:="C:\\TEST\\FILE1.TST":"C:\\TEST\\FILE2.TST":"C:\\TEST\\FILE3.TST";
AttRetList:=@ExtractDetachOSFileFromNote(NOTEHANDLE1;OPTIONS1;SINCE1;FNLIST1;TEXTLIST2);
NOTEHANDLE1:=@CloseNote(NOTEHANDLE1;0);
VIEWHANDLE1:=@CloseView(VIEWHANDLE1);
DBHANDLE1:=@CloseDB(DBHANDLE1);
If possible, the file attachments at positions 1,4 and 5 in the Attachment-List are created from the document with the NOTEHANDLE NOTEHANDLE1 as files "C:\\TEST\\FILE1.TST","C:\\TEST\\FILE2.TST" and "C:\\TEST\\FILE3.TST" created.
If the files could be created, AttRetList contains 1:1:1; otherwise, it contains 0:0:0.
If, for example, only the file with the Position 5 could not be created (file name "C:\\TEST\\FILE3.TST") (the others already) would be the result in AttRetList 1:1:0.
The file creation date was not considered (SINCE1:=@AnyAllDay).
The OPTIONS1 ("FOD") have the following meaning here:
TEXTLIST2 is treated as file nameList, existing files with the same name would be overwritten and should a directory C:\TEST does not exist, it would be created.
Note : This text was machine-translated and may contain inaccuracies.
