FileName: String;
The FileName property determines the path and name of the file stored in the document. The application used for document contents looking is determined by the file extension.
Executing the example requires the Document object with the Document_1 identifier in repository.
Sub UserProc;
Var
MB: IMetabase;
Doc: IDocument;
s, Name: String;
i: Integer;
Begin
MB := MetabaseClass.Active;
Doc := MB.ItemById("Document_1").Bind As IDocument;
s := Doc.FileName;
i := s.LastIndexOf("\");
Name := s.SubString(i + 1, s.Length - i);
Doc.SaveToFile("c:\" + Name);
End Sub UserProc;
After executing this example the file contained in the Document_1 document is saved in the root of disk C.
See also: