Class TNotesDocument (unit Class_LotusNotes)

Inherits from

TPersistent

Notes document

Constructors


constructor Create (notesDatabase: TNotesDatabase; anId: longint);

create new DOCUMENT in the database (see also TNotesDatabase.

constructor CreateNew(notesDatabase: TNotesDatabase);

ClassMarker_Method(TNotesRichTextItem) (******************************************************************************) { TNotesDocument} (


Functions

function Attach (AName: string): integer;

return index in Attachment or -1

*****************************************************************************)


procedure DeleteItem (ItemName: string);

detach a file attached to a form with a given name

**********************************************


destructor Destroy;

open a document by its UNID

*****************************************************************************)


procedure Detach (Index: integer; FileName: string);

attach a file by its name

*****************************************************************************)


function FindAttachment(aName: string): integer;

***************************************************

function GetSignature (var SignedBy: string; var CertifiedBy: string; pTime: PTDateTime): boolean;

sends a document.

function IsItemExists(ItemName: string): boolean;

deletes an item

***************************************************


procedure ReloadFields;

Clears fields list and reloads it from the document Call Save before to commit changes

*****************************************************************************)


function ReplaceItemValue(itemName: string; value: Variant): TNotesItem;

*****************************************************************************)

procedure Save(force, createResponse, markRead: boolean);

sets field value

*****************************************************************************)


procedure Send(attachForm: boolean; ARecipients: string);

saves a document

*****************************************************************************)


procedure Sign;

Get signature information.

function GetAttachment(Index: integer): string;

***************************************************

function GetAttachmentCount: integer;

***************************************************

function GetBodyAsMemo: TStrings;

*****************************************************************************)

function GetBodyAsString: string;

*****************************************************************************)

function GetFieldCount : longint;

**********************************************

function GetFieldName (Index: integer): string;

**********************************************

function GetItemByName (ItemName: string): TNotesItem;

**********************************************

function GetItemByNum (ItemNum: integer): string;

*****************************************************************************)

function GetRecipients: string;

*****************************************************************************)

procedure LoadFontTable;

***************************************************

procedure SaveFontTable;

***************************************************

procedure SetBodyAsMemo(Value: TStrings);

*****************************************************************************)

procedure SetBodyAsString(Value: string);

*****************************************************************************)

procedure SetItemByNum (ItemNum: integer; Value: string);

*****************************************************************************)

procedure SetRecipients(Value: string);

*****************************************************************************)

Properties

property Attachment : string

number of file attachments

property AttachmentCount : integer

These are Document attachment handling

property Body : TStrings

List of recipients If recipients = '', then SendTo field is used

property BodyAsString : string

body field

property Database : TNotesDatabase


property DocID : integer

signs a document

property FieldCount : longint

Items Use Items[Name].

property FieldName : string


property Form : string

Special fields for mail documents Note that using this fields do not change doc items obtained from Items property

property Handle : integer


property Items : TNotesItem


property MailFrom : string

Addressee - ONLY ONE ADDRESS! For multiple addresses use Recipients

property Recipients : string

sender

property SendTo : string

subject field

property Subject : string

form name

Events

Variables

FAttach : TStrings;


FDatabase : TNotesDatabase;


FFields : TStringList;


FFontTable : TStringList;


fHandle : integer;


fId : integer;


FMaxAttachment : word;


FMaxFontID : word;



Constructors


constructor Create (notesDatabase: TNotesDatabase; anId: longint);

create new DOCUMENT in the database (see also TNotesDatabase.CreateDocument

*****************************************************************************)


constructor CreateNew(notesDatabase: TNotesDatabase);

ClassMarker_Method(TNotesRichTextItem) (******************************************************************************) { TNotesDocument} (


Functions


function Attach (AName: string): integer;

return index in Attachment or -1

*****************************************************************************)


procedure DeleteItem (ItemName: string);

detach a file attached to a form with a given name

**********************************************


destructor Destroy;

open a document by its UNID

*****************************************************************************)


procedure Detach (Index: integer; FileName: string);

attach a file by its name

*****************************************************************************)


function FindAttachment(aName: string): integer;

***************************************************


function GetSignature (var SignedBy: string; var CertifiedBy: string; pTime: PTDateTime): boolean;

sends a document. if ARecipients <> '', overrides previously assigned addressees if Database.SaveMail = True, also saves a document

**********************************************


function IsItemExists(ItemName: string): boolean;

deletes an item

***************************************************


procedure ReloadFields;

Clears fields list and reloads it from the document Call Save before to commit changes

*****************************************************************************)


function ReplaceItemValue(itemName: string; value: Variant): TNotesItem;

*****************************************************************************)


procedure Save(force, createResponse, markRead: boolean);

sets field value

*****************************************************************************)


procedure Send(attachForm: boolean; ARecipients: string);

saves a document

*****************************************************************************)


procedure Sign;

Get signature information. SignedBy is user name, CertifiedBy - domain name. pTime can be nil Returns True if document is signed and signature is valid

**********************************************


function GetAttachment(Index: integer): string;

***************************************************


function GetAttachmentCount: integer;

***************************************************


function GetBodyAsMemo: TStrings;

*****************************************************************************)


function GetBodyAsString: string;

*****************************************************************************)


function GetFieldCount : longint;

**********************************************


function GetFieldName (Index: integer): string;

**********************************************


function GetItemByName (ItemName: string): TNotesItem;

**********************************************


function GetItemByNum (ItemNum: integer): string;

*****************************************************************************)


function GetRecipients: string;

*****************************************************************************)


procedure LoadFontTable;

***************************************************


procedure SaveFontTable;

***************************************************


procedure SetBodyAsMemo(Value: TStrings);

*****************************************************************************)


procedure SetBodyAsString(Value: string);

*****************************************************************************)


procedure SetItemByNum (ItemNum: integer; Value: string);

*****************************************************************************)


procedure SetRecipients(Value: string);

*****************************************************************************)


Properties


property Attachment : string

number of file attachments


property AttachmentCount : integer

These are Document attachment handling


property Body : TStrings

List of recipients If recipients = '', then SendTo field is used


property BodyAsString : string

body field


property Database : TNotesDatabase


property DocID : integer

signs a document


property FieldCount : longint

Items Use Items[Name].As... to read/write document properties


property FieldName : string


property Form : string

Special fields for mail documents Note that using this fields do not change doc items obtained from Items property


property Handle : integer


property Items : TNotesItem


property MailFrom : string

Addressee - ONLY ONE ADDRESS! For multiple addresses use Recipients


property Recipients : string

sender


property SendTo : string

subject field


property Subject : string

form name


Events


Variables


FAttach : TStrings;


FDatabase : TNotesDatabase;


FFields : TStringList;


FFontTable : TStringList;


fHandle : integer;


fId : integer;


FMaxAttachment : word;


FMaxFontID : word;