|
|
|
|
NotesExtractAttachment (Function) In french: NotesExtraitFichierAttaché Extracts a file attached to an item of the current document in Lotus Notes. This file is automatically copied to the specified location.
// Open the connection ConnectionID is int ConnectionID = NotesOpenConnection("Password", "MarsServer", ... "C:\Users\Julia\AppData\Local\Lotus\Notes\Data\user.id") // Specify the Lotus Notes database to use DatabaseID is int DatabaseID = NotesOpenDatabase(ConnectionID, "julia.nsf") ... // Read the first document NotesDocumentFirst(DatabaseID) ... // Attach a file to the current document FileNum is int FileNum = NotesAddAttachment(DatabaseID, "MyLotusNotesItem", ... "C:\MesDocuments\MyFile.TXT") ... // Extract this file NotesExtractAttachment(DatabaseID, "MyLotusNotesItem", FileNum, "D:\MyFiles\FileA.TXT")
// Open the connection ConnectionID is int ConnectionID = NotesOpenConnection("Password", "MarsServer", ... "C:\Users\Julia\AppData\Local\Lotus\Notes\Data\user.id") // Specify the Lotus Notes database to use DatabaseID is int DatabaseID = NotesOpenDatabase(ConnectionID, "julia.nsf") ... // Read the first document NotesDocumentFirst(DatabaseID) ... // List the files attached to the Lotus Notes item named "MyLotusNotesItem" FileList is string FileList = NotesListAttachment(ConnectionID, "MyLotusNotesItem") ... // For each attached file AFile is string i is int = 1 FOR EACH STRING AFile OF FileList SEPARATED BY CR // Copies the attached file into the project directory NotesExtractAttachment(DatabaseID, "MyLotusNotesItem", i, fExeDir() + ["\"] + AFile) i++ END
Syntax
<Result> = NotesExtractAttachment(<Session identifier> , <Lotus Notes item> , <File index> , <Location of copied file>)
<Result>: Boolean - True if the file was extracted,
- False otherwise. If an error occurs, the ErrorOccurred variable is set to True.
To get more details on the error, use ErrorInfo with the errMessage constant.
<Session identifier>: Integer Session ID to be used. This identifier is returned by EmailStartNotesSession or NotesOpenDatabase. <Lotus Notes item>: Character string Name of the "Rich Text" Lotus Notes item to which the file is attached. In most cases, this control corresponds to the "BODY" control.To know the name and type of the items in the current Notes document, use NotesListItem. <File index>: Integer Index of the file to extract. This index corresponds to the rank of the file in the list of files for the Lotus Notes item (for example, the index of the 3rd attachment will be 3).Caution: The indices of the files are modified when a file is deleted. <Location of copied file>: Character string Name and full path of the file to extract. Remarks Each item of a Notes document can contain up to 256 attached files.
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|