Aspose::Words::WebExtensions Namespace Reference

Detailed Description

The Aspose.Words.WebExtensions namespace provides classes that allow to customize elements and attributes that extend the XML vocabulary for representing Office Add-ins.

Classes

class  BaseWebExtensionCollection
 Base class for TaskPaneCollection, WebExtensionBindingCollection, WebExtensionPropertyCollection and WebExtensionReferenceCollection collections. More...
 
class  TaskPane
 Represents an add-in task pane object. More...
 
class  TaskPaneCollection
 Specifies a list of persisted task pane objects. More...
 
class  WebExtension
 Represents a web extension object. More...
 
class  WebExtensionBinding
 Specifies a binding relationship between a web extension and the data in the document. More...
 
class  WebExtensionBindingCollection
 Specifies a list of web extension bindings. More...
 
class  WebExtensionProperty
 Specifies a web extension custom property. More...
 
class  WebExtensionPropertyCollection
 Specifies a set of web extension custom properties. More...
 
class  WebExtensionReference
 Represents the reference to a web extension. The reference is used to identify the provider location and version of the extension. More...
 
class  WebExtensionReferenceCollection
 Specifies a list of web extension references. More...
 

Enumerations

enum class  TaskPaneDockState
 Enumerates available locations of task pane object. More...
 
enum class  WebExtensionBindingType
 Enumerates available types of binding between a web extension and the data in the document. More...
 
enum class  WebExtensionStoreType
 Enumerates available types of a web extension store. More...
 

Enumeration Type Documentation

◆ TaskPaneDockState

Enumerates available locations of task pane object.

Examples

Shows how to add a web extension to a document.

auto doc = MakeObject<Document>();
// Create task pane with "MyScript" add-in, which will be used by the document,
// then set its default location.
auto myScriptTaskPane = MakeObject<TaskPane>();
doc->get_WebExtensionTaskPanes()->Add(myScriptTaskPane);
myScriptTaskPane->set_DockState(TaskPaneDockState::Right);
myScriptTaskPane->set_IsVisible(true);
myScriptTaskPane->set_Width(300);
myScriptTaskPane->set_IsLocked(true);
// If there are multiple task panes in the same docking location, we can set this index to arrange them.
myScriptTaskPane->set_Row(1);
// Create an add-in called "MyScript Math Sample", which the task pane will display within.
SharedPtr<WebExtension> webExtension = myScriptTaskPane->get_WebExtension();
// Set application store reference parameters for our add-in, such as the ID.
webExtension->get_Reference()->set_Id(u"WA104380646");
webExtension->get_Reference()->set_Version(u"1.0.0.0");
webExtension->get_Reference()->set_StoreType(WebExtensionStoreType::OMEX);
webExtension->get_Reference()->set_Store(System::Globalization::CultureInfo::get_CurrentCulture()->get_Name());
webExtension->get_Properties()->Add(MakeObject<WebExtensionProperty>(u"MyScript", u"MyScript Math Sample"));
webExtension->get_Bindings()->Add(MakeObject<WebExtensionBinding>(u"MyScript", WebExtensionBindingType::Text, u"104380646"));
// Allow the user to interact with the add-in.
webExtension->set_IsFrozen(false);
// We can access the web extension in Microsoft Word via Developer -> Add-ins.
doc->Save(ArtifactsDir + u"Document.WebExtension.docx");
// Remove all web extension task panes at once like this.
doc->get_WebExtensionTaskPanes()->Clear();
ASSERT_EQ(0, doc->get_WebExtensionTaskPanes()->get_Count());
Enumerator
Right 

Dock the task pane on the right side of the document window.

Left 

Dock the task pane on the left side of the document window.

◆ WebExtensionBindingType

Enumerates available types of binding between a web extension and the data in the document.

Examples

Shows how to add a web extension to a document.

auto doc = MakeObject<Document>();
// Create task pane with "MyScript" add-in, which will be used by the document,
// then set its default location.
auto myScriptTaskPane = MakeObject<TaskPane>();
doc->get_WebExtensionTaskPanes()->Add(myScriptTaskPane);
myScriptTaskPane->set_DockState(TaskPaneDockState::Right);
myScriptTaskPane->set_IsVisible(true);
myScriptTaskPane->set_Width(300);
myScriptTaskPane->set_IsLocked(true);
// If there are multiple task panes in the same docking location, we can set this index to arrange them.
myScriptTaskPane->set_Row(1);
// Create an add-in called "MyScript Math Sample", which the task pane will display within.
SharedPtr<WebExtension> webExtension = myScriptTaskPane->get_WebExtension();
// Set application store reference parameters for our add-in, such as the ID.
webExtension->get_Reference()->set_Id(u"WA104380646");
webExtension->get_Reference()->set_Version(u"1.0.0.0");
webExtension->get_Reference()->set_StoreType(WebExtensionStoreType::OMEX);
webExtension->get_Reference()->set_Store(System::Globalization::CultureInfo::get_CurrentCulture()->get_Name());
webExtension->get_Properties()->Add(MakeObject<WebExtensionProperty>(u"MyScript", u"MyScript Math Sample"));
webExtension->get_Bindings()->Add(MakeObject<WebExtensionBinding>(u"MyScript", WebExtensionBindingType::Text, u"104380646"));
// Allow the user to interact with the add-in.
webExtension->set_IsFrozen(false);
// We can access the web extension in Microsoft Word via Developer -> Add-ins.
doc->Save(ArtifactsDir + u"Document.WebExtension.docx");
// Remove all web extension task panes at once like this.
doc->get_WebExtensionTaskPanes()->Clear();
ASSERT_EQ(0, doc->get_WebExtensionTaskPanes()->get_Count());
Enumerator
Matrix 

Tabular data without a header row.

Table 

Tabular data with a header row.

Text 

Plain text.

Default 

◆ WebExtensionStoreType

Enumerates available types of a web extension store.

Examples

Shows how to add a web extension to a document.

auto doc = MakeObject<Document>();
// Create task pane with "MyScript" add-in, which will be used by the document,
// then set its default location.
auto myScriptTaskPane = MakeObject<TaskPane>();
doc->get_WebExtensionTaskPanes()->Add(myScriptTaskPane);
myScriptTaskPane->set_DockState(TaskPaneDockState::Right);
myScriptTaskPane->set_IsVisible(true);
myScriptTaskPane->set_Width(300);
myScriptTaskPane->set_IsLocked(true);
// If there are multiple task panes in the same docking location, we can set this index to arrange them.
myScriptTaskPane->set_Row(1);
// Create an add-in called "MyScript Math Sample", which the task pane will display within.
SharedPtr<WebExtension> webExtension = myScriptTaskPane->get_WebExtension();
// Set application store reference parameters for our add-in, such as the ID.
webExtension->get_Reference()->set_Id(u"WA104380646");
webExtension->get_Reference()->set_Version(u"1.0.0.0");
webExtension->get_Reference()->set_StoreType(WebExtensionStoreType::OMEX);
webExtension->get_Reference()->set_Store(System::Globalization::CultureInfo::get_CurrentCulture()->get_Name());
webExtension->get_Properties()->Add(MakeObject<WebExtensionProperty>(u"MyScript", u"MyScript Math Sample"));
webExtension->get_Bindings()->Add(MakeObject<WebExtensionBinding>(u"MyScript", WebExtensionBindingType::Text, u"104380646"));
// Allow the user to interact with the add-in.
webExtension->set_IsFrozen(false);
// We can access the web extension in Microsoft Word via Developer -> Add-ins.
doc->Save(ArtifactsDir + u"Document.WebExtension.docx");
// Remove all web extension task panes at once like this.
doc->get_WebExtensionTaskPanes()->Clear();
ASSERT_EQ(0, doc->get_WebExtensionTaskPanes()->get_Count());
Enumerator
SPCatalog 

Specifies that the store type is SharePoint corporate catalog.

OMEX 

Specifies that the store type is Office.com.

SPApp 

Specifies that the store type is a SharePoint web application.

Exchange 

Specifies that the store type is an Exchange server.

FileSystem 

Specifies that the store type is a file system share.

Registry 

Specifies that the store type is the system registry.

ExCatalog 

Specifies that the store type is Centralized Deployment via Exchange.

Default 

Default value.