Open matthewfitzmaurice opened 2 weeks ago
hi @matthewfitzmaurice, thx for your submit. May I confirm that, the meaning of 'ribbon button function' is creating a ribbon addin, which contains one button to execute that example code function?
Yes. It is also possible to create an office add-in with a manifest that contains 2 buttons on the ribbon. One button creates a task pane whereas the other just calls a function.
Get Outlook for Androidhttps://aka.ms/AAb9ysg
From: RuizhiSunMS @.> Sent: Tuesday, November 5, 2024 7:49:31 PM To: OfficeDev/office-js @.> Cc: Matthew Fitzmaurice @.>; Mention @.> Subject: Re: [OfficeDev/office-js] Code works when called from Task Pane but not when called from Function (Issue #5042)
hi @matthewfitzmauricehttps://github.com/matthewfitzmaurice, thx for your submit. May I confirm that, the meaning of 'ribbon button function' is creating a ribbon addin, which contains one button to execute that example code function?
— Reply to this email directly, view it on GitHubhttps://github.com/OfficeDev/office-js/issues/5042#issuecomment-2456962026, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AA4DOOTU6FX3VPMFSWEI3KLZ7CWEXAVCNFSM6AAAAABRGH3MU2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINJWHE3DEMBSGY. You are receiving this because you were mentioned.Message ID: @.***>
hi @matthewfitzmaurice , would you please share your files with us? It could be helpful to accelerate our investigation.
TemplaBee.Office.js.NAA - Sample.zip
Please unzip this attachment. The ribbon contains a custom tab with two buttons on it. You will see that the buttons are labelled 'Refresh Links (works)' and 'Refresh Links (Does NOT work)'.
Test scenario:
Create work item #9509954 to track it, the team will investigate and we will reply to you as soon as there is any progress. Thank you for your patience.
Code works when called from Task Pane but not when called from Function
Environment
Expected behavior
I expect code to produce the same results whether run from a Task Pane or a Function.
Current behavior
The example code listed in the Field.UpdateResult documentation works when run in a Task Pane. The code does NOT work when run from a Ribbon Button function. https://learn.microsoft.com/en-us/javascript/api/word/word.field?view=word-js-preview#word-word-field-updateresult-member(1)
Steps to reproduce