SaveToStream(Stream: IIOStream);
Stream - stream, to which the Flash object is saved.
The SaveToStream method saves the Flash object to the stream that is passed by the Stream parameter.
Executing the example requires a regular report with the Flash object that is placed on the active sheet of the report.
Sub SaveFlash;
Var
MB: IMetabase;
MObj: IMetabaseObject;
CrInfo: IMetabaseObjectCreateInfo;
Doc: IDocument;
MemStr: IMemoryStream;
Sheet: IPrxTable;
Fl: IPrxFlash;
Begin
MB := MetabaseClass.Active;
CrInfo := MB.CreateCreateInfo;
CrInfo.ClassID := MetabaseObjectClass.KE_CLASS_DOCUMENT;
CrInfo.Id := "Flash_Document";
CrInfo.Name := "Flash_Document";
CrInfo.Parent := MB.Root;
CrInfo.Permanent := True;
MObj := MB.CreateObject(CrInfo).Edit;
Doc := MObj As IDocument;
Sheet := PrxReport.ActiveReport.ActiveSheet As IPrxTable;
Fl := Sheet.TabSheet.Objects.Item(0).Extension As IPrxFlash;
MemStr := New MemoryStream.Create;
Fl.ShockWaveFlash.SaveToStream(MemStr);
Doc.LoadFromStream(MemStr);
MObj.Save;
Dispose MemStr;
End Sub SaveFlash;
This example is a regular report macro. After execution of macro, the Flash object that is placed on the active sheet of the regular report, is saved in the Document repository object with the Flash_Document identifier.
See also: