TaskPane Class

Represents an add-in task pane object.

Inheritance Hierarchy

SystemObject
  Aspose.Words.WebExtensionsTaskPane

Namespace:  Aspose.Words.WebExtensions
Assembly:  Aspose.Words (in Aspose.Words.dll) Version: 20.7.0

Syntax

public class TaskPane

The TaskPane type exposes the following members.

Constructors

  NameDescription
Public methodTaskPane
Initializes a new instance of the TaskPane class

Properties

  NameDescription
Public propertyCode exampleDockState
Specifies the last-docked location of this task pane object.
Public propertyCode exampleIsLocked
Specifies whether the task pane is locked to the document in the UI and cannot be closed by the user.
Public propertyCode exampleIsVisible
Specifies whether the task pane shows as visible by default when the document opens.
Public propertyCode exampleRow
Specifies the index, enumerating from the outside to the inside, of this task pane among other persisted task panes docked in the same default location.
Public propertyCode exampleWebExtension
Represents an web extension object.
Public propertyCode exampleWidth
Specifies the default width value for this task pane instance.

Methods

  NameDescription
Public methodEquals (Inherited from Object.)
Public methodGetHashCode (Inherited from Object.)
Public methodGetType (Inherited from Object.)
Public methodToString (Inherited from Object.)

Examples

Shows how to create add-ins inside the document.
Document doc = new Document();

// Create taskpane with "MyScript" add-in which will be used by the document
TaskPane myScriptTaskPane = new TaskPane();
doc.WebExtensionTaskPanes.Add(myScriptTaskPane);

// Define task pane location when the document opens
myScriptTaskPane.DockState = TaskPaneDockState.Right;
myScriptTaskPane.IsVisible = true;
myScriptTaskPane.Width = 300;
myScriptTaskPane.IsLocked = true;
// Use this option if you have several task panes
myScriptTaskPane.Row = 1;

// Add "MyScript Math Sample" add-in which will be displayed inside task pane
WebExtension webExtension = myScriptTaskPane.WebExtension;

// Application Id from store
webExtension.Reference.Id = "WA104380646";
// The current version of the application used
webExtension.Reference.Version = "1.0.0.0";
// Type of marketplace
webExtension.Reference.StoreType = WebExtensionStoreType.OMEX;
// Marketplace based on your locale
webExtension.Reference.Store = CultureInfo.CurrentCulture.Name;

webExtension.Properties.Add(new WebExtensionProperty("MyScript", "MyScript Math Sample"));
webExtension.Bindings.Add(new WebExtensionBinding("MyScript", WebExtensionBindingType.Text, "104380646"));

// Use this option if you need to block web extension from any action
webExtension.IsFrozen = false;

doc.Save(ArtifactsDir + "Document.WebExtension.docx");

See Also