Aspose.words.webextensions not working properly

As specified example in documentation. WebExtension Class | Aspose.Words for .NET
I have use code for my add-in to open add-in with the document(.docx) but add in not visible after opening document.
Also as given in example reference id for add-in is also not working “WA104380646” i.e. add in not open visible after document open.

I am using Aspose.Words Version 21.8.0.0

Please suggest what should be problem in this.

@himanshu44 The code works, but the referenced add-in seems to be removed. Please try the following code, which insert Wikipedia add-in:

Document doc = new Document();

// Create task pane with "Wikipedia" add-in, which will be used by the document,
// then set its default location.
TaskPane wikiPane = new TaskPane();
doc.WebExtensionTaskPanes.Add(wikiPane);
wikiPane.DockState = TaskPaneDockState.Right;
wikiPane.IsVisible = true;
wikiPane.Width = 300;
wikiPane.IsLocked = true;

// If there are multiple task panes in the same docking location, we can set this index to arrange them.
wikiPane.Row = 1;

// Create an add-in
WebExtension webExtension = wikiPane.WebExtension;

// Set application store reference parameters for our add-in, such as the ID.
webExtension.Reference.Id = "WA104099688";
webExtension.Reference.Version = "1.3.0.0";
webExtension.Reference.StoreType = WebExtensionStoreType.OMEX;
webExtension.Reference.Store = CultureInfo.CurrentCulture.Name;
            
// Allow the user to interact with the add-in.
webExtension.IsFrozen = false;

// We can access the web extension in Microsoft Word via Developer -> Add-ins.
doc.Save(@"C:\Temp\out.docx");

Thank you for your quick response @alexey.noskov.

I have check your code and it’s working as I expected.
But for my custom add-in(deployed on office store WA200003812) It’s not working. Am I missing any configuration in manifest file of my deployed add-in on office store.
It will be a great if you suggest about this issue.

@himanshu44 Are you able to add your custom add-in in MS Word? Could you please add it using MS Word and attach the document here for our reference. We will check the issue and provide you more information.

abc.docx (10.6 KB)

Here I have attached test file in which add-in is included.
Please check and suggest me.

@himanshu44 Thank you for additional information. As I can see the following code properly adds IRIS CARBON® Hive add-in into the document:

Document doc = new Document();

TaskPane pane = new TaskPane();
doc.WebExtensionTaskPanes.Add(pane);
pane.DockState = TaskPaneDockState.Right;
pane.IsVisible = true;
pane.Width = 300;
pane.IsLocked = true;
pane.Row = 1;

// Create an add-in
WebExtension webExtension = pane.WebExtension;

// Set application store reference parameters for our add-in, such as the ID.
webExtension.Reference.Id = "WA200003812";
webExtension.Reference.Version = "1.3.0.0";
webExtension.Reference.StoreType = WebExtensionStoreType.OMEX;
webExtension.Reference.Store = CultureInfo.CurrentCulture.Name;

// Allow the user to interact with the add-in.
webExtension.IsFrozen = false;

// We can access the web extension in Microsoft Word via Developer -> Add-ins.
doc.Save(@"C:\Temp\out.docx");

out.docx (8.1 KB)

Please check video shared.

https://himanshu-gmail-88.tinytake.com/df/13165ec/thumbnail?type=attachments&version_no=0&file_version_no=0&thumbnail_size=preview

In this add-in is loaded but not open by default.(as previously checked Wikipedia add-in is opened by default.)
Please suggest, when I open document it should be load and open by default.
It’s major issue I am facing from few days.

@himanshu44 Could you please create the expected output using MS Word and attach it here? Look like add-ins simply have different UI and that is why Wikipedia plugin appears at right but IRIS CARBON® Hive does not.

NewTest.docx (13.8 KB)

Please check this NewTest.docx created using using MS Word.

@himanshu44 Here is what I see on my side when open the attached document:

Yes something wrong in add in. I can see error message on reopen as follows.

May be I missed this setting. Need to check out at my end.

<Action xsi:type="ShowTaskpane">
  <TaskpaneId>Office.AutoShowTaskpaneWithDocument</TaskpaneId>
  <SourceLocation resid="Contoso.Taskpane.Url" />
</Action>

Thanks for your quick reply. Will check and connect with you if required.

1 Like