Creating a Document

Executing the example requires the Icons_1.bmp file that contains a set of icons.

Sub UserProc;
Var
    MB: IMetabase;
    CrInfo: IMetabaseObjectCreateInfo;
    Doc: IDocument;
Begin
    MB := MetabaseClass.Active;
    CrInfo := MB.CreateCreateInfo;
    CrInfo.ClassID := MetabaseObjectClass.KE_CLASS_DOCUMENT;
    CrInfo.Id := "NewDocument";
    CrInfo.Name := "Document with icons";
    CrInfo.Parent := MB.Root;
    Doc := MB.CreateObject(CrInfo).Edit As IDocument;
    Doc.LoadFromFile("c:\Icons_1.bmp");
    (Doc As IMetabaseObject).Save;
End Sub UserProc;

After executing the example the New Document object is created in the root folder. This document will contain the Icons_1.bmp graphic file. It can be used further for connection in the GlobalImageList component.

See also:

Examples