IDocumentBase.LoadFromFile

Syntax

LoadFromFile(FileName: String);

Parameters

FileName. Path and name of the file that should be loaded into the document.

Description

The LoadFromFile method loads the file passed by the FileName parameter into the document.

Comments

This method automatically saves the loaded file in the database before calling the IMetabaseObject.Save method.

Example

Executing the example requires a form with the Button1 button, the Image_1.jpg file located in the root of disc C, a repository object with the IMAGE identifier.

    Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
    
Var
        MB: IMetabase;
        Doc: IDocument;
    
Begin
        MB := MetabaseClass.Active;
        Doc := MB.ItemById(
"IMAGE").Edit As IDocument;
        Doc.LoadFromFile(
"C:\Image_1.jpg");
    
End Sub Button1OnClick;

After executing the example and clicking the button the Image_1.jpg file is loaded to the IMAGE repository object.

See also:

IDocumentBase