How to insert a floating element?

Campbell, Callum (LNG-PLZ) 0 Reputation points
2023-07-27T08:47:43.0233333+00:00

We have a use-case in our Office365/OfficeJS plugin where we need to insert a textbox-like element to a Word document. It's important that this element can be dragged around freely by the user without moving other elements on the document. We have tried to add a textbox, but it doesn't seem like this is possible with the package at the moment.

For the meantime, we have added a table, and inserted the information we need inside this table. However, when the user moves the table, it moves all the other elements around the page. They also aren't able to place the table near the bottom of the page for example, as this sends it to the next page.

We also explored using an image, but again, the package only allows inserting inline images, so dragging the image around moves other elements on the document.

Has anyone been able to insert any kind of "floating" element with the package, that can be dragged around freely without disturbing other elements? We'd also need to query the document at a later stage, to get a list of all these elements we insert. We're currently able to do that with the table.

Any assistance would be greatly appreciated.

Microsoft 365 and Office Development Office JavaScript API
0 comments No comments
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.