OfficeDev / office-js

A repo and NPM package for Office.js, corresponding to a copy of what gets published to the official "evergreen" Office.js CDN, at https://appsforoffice.microsoft.com/lib/1/hosted/office.js.
https://learn.microsoft.com/javascript/api/overview
Other
685 stars 95 forks source link

Resize taskpane programmatically #3659

Open shermaro91 opened 1 year ago

shermaro91 commented 1 year ago

Dear Team, I have a requirement to dynamically adjust the size of my task pane programmatically. Depending on the specific functionality I'm using, I may need to resize the task pane to accommodate different content, sometimes requiring more space and other times less. How can I achieve this functionality?

My Environment Platform : PC desktop Host: Word Office version number: Microsoft® Word for Microsoft 365 MSO (Version 2308 Build 16.0.16731.20052) 64-bit Operating System: Windows 10 pro

JHJ-MS commented 1 year ago

What I remember is Office JS API doesn't support dynamically adjusting the size of the task pane. You can try this to see whether it works for setting the default task pane size. If not, welcome to vote for the feature asked on this website.

ZYUN-MSFT commented 1 year ago

Hi @shermaro91 ,

Please try the solustion provided by @JHJ-MS . We'd like to know whether this workaround works for you.

Thanks.

shermaro91 commented 1 year ago

Thanks for quick response @ZYUN-MSFT , The solution which is mentioned by @JHJ-MS will not be helpful in our case. We wanted to set task pane width based on the data which we want to display in task pane.

ZYUN-MSFT commented 1 year ago

Hi @shermaro91 ,

Thanks for the clarify. For this scenario's feature is not currently supported. Please raise the New Feature Ask at https://techcommunity.microsoft.com/t5/microsoft-365-developer-platform/idb-p/Microsoft365DeveloperPlatform . Feature requests on it are considered when we go through our planning process.

Thanks for your support for Office Addin.

abhijitrc commented 9 months ago

I am also exploring the possibility of setting Excel web add-ins task pane width, is there a possibility of doing it?.