search/mag_sel search/close
Aspose::Words::Drawing::OlePackage Class Reference

Allows to access OLE Package properties.

Examples

Shows how insert an OLE object into a document.

auto doc = MakeObject<Document>();
auto builder = MakeObject<DocumentBuilder>(doc);
// OLE objects allow us to open other files in the local file system using another installed application
// in our operating system by double-clicking on the shape that contains the OLE object in the document body.
// In this case, our external file will be a ZIP archive.
ArrayPtr<uint8_t> zipFileBytes = System::IO::File::ReadAllBytes(DatabaseDir + u"cat001.zip");
{
auto stream = MakeObject<System::IO::MemoryStream>(zipFileBytes);
SharedPtr<Shape> shape = builder->InsertOleObject(stream, u"Package", true, nullptr);
shape->get_OleFormat()->get_OlePackage()->set_FileName(u"Package file name.zip");
shape->get_OleFormat()->get_OlePackage()->set_DisplayName(u"Package display name.zip");
}
doc->Save(ArtifactsDir + u"Shape.InsertOlePackage.docx");

#include <Aspose.Words.Cpp/Drawing/OlePackage.h>

+ Inheritance diagram for Aspose::Words::Drawing::OlePackage:

Public Member Functions

String get_DisplayName () const
 Gets or sets OLE Package display name. More...
 
String get_FileName () const
 Gets or sets OLE Package file name. More...
 
virtual const TypeInfoGetType () const override
 
virtual bool Is (const TypeInfo &target) const override
 
void set_DisplayName (String value)
 Setter for get_DisplayName. More...
 
void set_FileName (String value)
 Setter for get_FileName. More...
 

Static Public Member Functions

static const TypeInfoType ()
 

Member Function Documentation

◆ get_DisplayName()

System::String Aspose::Words::Drawing::OlePackage::get_DisplayName ( ) const

Gets or sets OLE Package display name.

Examples

Shows how insert an OLE object into a document.

auto doc = MakeObject<Document>();
auto builder = MakeObject<DocumentBuilder>(doc);
// OLE objects allow us to open other files in the local file system using another installed application
// in our operating system by double-clicking on the shape that contains the OLE object in the document body.
// In this case, our external file will be a ZIP archive.
ArrayPtr<uint8_t> zipFileBytes = System::IO::File::ReadAllBytes(DatabaseDir + u"cat001.zip");
{
auto stream = MakeObject<System::IO::MemoryStream>(zipFileBytes);
SharedPtr<Shape> shape = builder->InsertOleObject(stream, u"Package", true, nullptr);
shape->get_OleFormat()->get_OlePackage()->set_FileName(u"Package file name.zip");
shape->get_OleFormat()->get_OlePackage()->set_DisplayName(u"Package display name.zip");
}
doc->Save(ArtifactsDir + u"Shape.InsertOlePackage.docx");

◆ get_FileName()

System::String Aspose::Words::Drawing::OlePackage::get_FileName ( ) const

Gets or sets OLE Package file name.

Examples

Shows how insert an OLE object into a document.

auto doc = MakeObject<Document>();
auto builder = MakeObject<DocumentBuilder>(doc);
// OLE objects allow us to open other files in the local file system using another installed application
// in our operating system by double-clicking on the shape that contains the OLE object in the document body.
// In this case, our external file will be a ZIP archive.
ArrayPtr<uint8_t> zipFileBytes = System::IO::File::ReadAllBytes(DatabaseDir + u"cat001.zip");
{
auto stream = MakeObject<System::IO::MemoryStream>(zipFileBytes);
SharedPtr<Shape> shape = builder->InsertOleObject(stream, u"Package", true, nullptr);
shape->get_OleFormat()->get_OlePackage()->set_FileName(u"Package file name.zip");
shape->get_OleFormat()->get_OlePackage()->set_DisplayName(u"Package display name.zip");
}
doc->Save(ArtifactsDir + u"Shape.InsertOlePackage.docx");

◆ GetType()

virtual const System::TypeInfo& Aspose::Words::Drawing::OlePackage::GetType ( ) const
overridevirtual

Reimplemented from System::Object.

◆ Is()

virtual bool Aspose::Words::Drawing::OlePackage::Is ( const System::TypeInfo target) const
overridevirtual

Reimplemented from System::Object.

◆ set_DisplayName()

void Aspose::Words::Drawing::OlePackage::set_DisplayName ( System::String  value)

◆ set_FileName()

void Aspose::Words::Drawing::OlePackage::set_FileName ( System::String  value)

◆ Type()

static const System::TypeInfo& Aspose::Words::Drawing::OlePackage::Type ( )
static