Office Add-ins development
376 TopicsPowerPoint.ShapeCollection.addFromBase64( base64File, options )
This API closes a large gap in the surface area of creating content in PowerPoint. There is already support for inserting new slides via the PowerPoint.insertSlidesFromBase64( base64File, options ) function. And, there's support for adding various geometric shapes and images via the PowerPoint.ShapeCollection.addGeometric/addLine/addTextBox methods. (Annoyingly, images need to be added with the generic setDataAsync method.) The new API would work similar to the insertSlidesFromBase64, accepting a list of shapeId/drawingElementCreationId of the shapes to insert from the base64 encoded slide.xml, or inserting all of the shapes on that slide. Additional options like specifying where in the z-order of the existing shape collection to insert the new shapes would be useful, too. Add-in developers could get the relevant slide.xml from a pre-generated presentation and extracting it. Or, if simpler, a complete PPTX file that contains only a single slide could be base64 encoded as provided by the new PowerPoint.Slide.exportAsBase64 method. Overall complexity of adding this new feature is fairly low. Use a parallel implementation structure as the insertSlidesFromBase64, but adding one extra depth traversal into the shape collection and then adding shapes to the current slide rather than slides to the current presentation.171Views6likes3CommentsIdentify multiple embedded instance of the same add-in in a file as one
Summary By default, when a file is opened in Excel with a JS add-in installed and then saved, the JS add-in is automatically embedded in the file. In the current design all embedded add-ins will be attempted to load when the file is opened even if the embedded add-ins are the same. As a result, when these files are shared with other users who already have the same JS add-in installed with a different version or deployment method, Excel displays two instances of the same add-in in the tabs, or occasionally shows an error in the task pane if the version it is embedded is an older one. We first became aware of this issue when a user reported seeing our JS add-in appear twice in the ribbon, which led to confusion. Upon inspecting the affected file’s XML web extensions, we identified two versions of the same add-in embedded: one deployed via OMEX and another via exCatalog. After further investigation and filing a ticket with Microsoft Support, it was confirmed that this behavior is by design under the current implementation. Why This Matters While we understand that this behavior is expected by design, it remains problematic for users—it can cause confusion and potential issues with custom functions or with the add-in itself. Also, it is not clear for As of the moment there are no easy workaround for users to remove the duplicate/additional instance of the same JS add-in embedded in the file, this will also need to be done for every file that is suffering from this issue (has multiple instance of the same add-in embedded in the file w/ different version/deployment method). Proposed Change/s Update current design to be able to identify if the embedded adds-in is the same through checking and comparing a unique id so even if they have different deployment/version tags it will not be loaded/attempted to be loaded in the task pane. Alternatives Considered Provide an option in Officejs API to prevent embedding/referencing add-in in a file Benefits Prevents users from seeing the same add-in appear twice in the file Eliminate propagating errors in the task pane from trying to render the same add-in with the old version tag [Alternative considered] Allow users/dev to be able to control which add-in gets embedded in the file85Views8likes2CommentsUpdate outlook.js to enable custom mail header with folding (RFC 5322)
I'm currently unable to add custom headers which are longer than 998 characters but conform to RFC 5322 (folding) to apply an RFC 7444 label. outlook.js has the total header size limit hard-coded to 998 (which actually only applies per header-line according to RFC 5322). Removing this hard-coded limit still causes tha call to fai. Expected result Sample header data (folded, binding-type="urn:nato:stanag:4778:bindinginformation:1:0";marking="CIAV UNCLASSIFIED Releasable to AUS AUT CHE GEO MOL NZL TUN UKR EEAS"; binding-data-object*0="PEJpbmRpbmdJbmZvcm1hdGlvbj48TWV0YWRhdGFCaW5k"; binding-data-object*1="aW5nQ29udGFpbmVyPjxNZXRhZGF0YUJpbmRpbmc+PE1l"; binding-data-object*2="dGFkYXRhPjxvcmlnaW5hdG9yQ29uZmlkZW50aWFsaXR5"; binding-data-object*3="TGFiZWw+PFBvbGljeUlkZW50aWZpZXI+Q0lBVjwvUG9s"; binding-data-object*4="aWN5SWRlbnRpZmllcj4KPENvbmZpZGVudGlhbGl0eUlu"; binding-data-object*5="Zm9ybWF0aW9uPjxDbGFzc2lmaWNhdGlvbj5VTkNMQVNT"; binding-data-object*6="SUZJRUQ8L0NsYXNzaWZpY2F0aW9uPgo8Q2F0ZWdvcnk+"; binding-data-object*7="PHRhZ05hbWU+UmVsZWFzYWJsZSBUbzwvdGFnTmFtZT4K"; binding-data-object*8="PEdlbmVyaWNWYWx1ZT5BVVM8L0dlbmVyaWNWYWx1ZT4K"; binding-data-object*9="PEdlbmVyaWNWYWx1ZT5BVVQ8L0dlbmVyaWNWYWx1ZT4K"; binding-data-object*10="PEdlbmVyaWNWYWx1ZT5DSEU8L0dlbmVyaWNWYWx1ZT4K"; binding-data-object*11="PEdlbmVyaWNWYWx1ZT5HRU88L0dlbmVyaWNWYWx1ZT4K"; binding-data-object*12="PEdlbmVyaWNWYWx1ZT5NT0w8L0dlbmVyaWNWYWx1ZT4K"; binding-data-object*13="PEdlbmVyaWNWYWx1ZT5OWkw8L0dlbmVyaWNWYWx1ZT4K"; binding-data-object*14="PEdlbmVyaWNWYWx1ZT5UVU48L0dlbmVyaWNWYWx1ZT4K"; binding-data-object*15="PEdlbmVyaWNWYWx1ZT5VS1I8L0dlbmVyaWNWYWx1ZT4K"; binding-data-object*16="PEdlbmVyaWNWYWx1ZT5FRUFTPC9HZW5lcmljVmFsdWU+"; binding-data-object*17="CjwvQ2F0ZWdvcnk+PC9Db25maWRlbnRpYWxpdHlJbmZv"; binding-data-object*18="cm1hdGlvbj48L29yaWdpbmF0b3JDb25maWRlbnRpYWxp"; binding-data-object*19="dHlMYWJlbD48L01ldGFkYXRhPjwvTWV0YWRhdGFCaW5k"; binding-data-object*20="aW5nPjwvTWV0YWRhdGFCaW5kaW5nQ29udGFpbmVyPjwv"; binding-data-object*21="QmluZGluZ0luZm9ybWF0aW9uPg=="; Sample JS code mailboxItem.internetHeaders.setAsync({'Binding-Data': bindingData}, function (asyncResult) { if (asyncResult.status === Office.AsyncResultStatus.Succeeded) { mailboxItem.saveAsync() // check if required console.log("success") callback(true); } else { console.log("error") callback(false); } } );Office Addin - First Letter Navigation in menus
Some UI components, such as dropdow lists, do support first letter navigation, i.e. lets the user navigate through the items of a list based on the first letter of the item's title. Here is a concreate example: In Word, go to File > Options > General > Office Background > Down arrow (to open the dropdown list). In here, if I press 'C' once, I land on 'Calligraphy'. If I press 'S' once, I land on 'School Supplies', press 'S' a second time I land on 'Spring', press 'S' a third time I land on 'Starts', and so forth. However, such navigation mechanism is not supported for menu components. For example: In Word, go to Insert > Link > Recent items. I have a long list of recently accessed Word of Excel documents (let's call them Document_1, Document_2, ..., Document_n). When I press 'D', I get an error beep and nothing happens. Indeed some items are linked to a keytip, but I cannot navigate the list as described above. We are developing some VSTO add-ins for Excel, Outlook, Powerpoint and Word for visually-impaired users. For each, we are creating a simplified ribbon that provides them with a subset of functionalities. For example: <?xml version="1.0" encoding="UTF-8"?> <customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui" onLoad="Ribbon_Load"> <ribbon startFromScratch="true"> <tabs> <tab id="MainMenu" getLabel="GetMenuLabel" visible="true" keytip="M"> <group id="FunctionsGroup" getLabel="GetGroupLabel"> <menu id="FileFunctions" keytip="F" getLabel="GetMenuLabel" > <!--Action_1--> <button id="Action_1" getLabel="GetButtonLabel" getImage="GetButtonImage" getScreentip="GetScreenTip" getSupertip="GetSuperTip" onAction="OnActionButton" /> <!--Action_2--> <button id="Action_2" getLabel="GetButtonLabel" getImage="GetButtonImage" getScreentip="GetScreenTip" getSupertip="GetSuperTip" onAction="OnActionButton" /> <!--Action_N--> <button id="Action_N" getLabel="GetButtonLabel" getImage="GetButtonImage" getScreentip="GetScreenTip" getSupertip="GetSuperTip" onAction="OnActionButton" /> .......... </menu> </group> </tab> </tabs> </ribbon> </customUI> Having first letter navigation work in menus would be a major gain in terms of accessibility throughout all available Office menus (which there are hundreds and more shared between all Office apps). My questions: Are there plans to support first letter navigation for menu components? Is there a way we can attach key event handlers to UI components such as menus that are created from a ribbon.xml file?Allow access to BCC property in office-js Message Read mode
Currently, we can only access the `bcc` property of a Mailbox Item if we are in the Message Compose context. This usually makes sense, since when we're in Message Read mode, we're probably reading emails sent to the user, so the user naturally shouldn't see BCC addresses. However, in the Sent folder, we should be able to access the `bcc` properties of the messages there, as they themselves should have set them. In our use case, our Addin would surface additional useful information to the user contingent on all of the recipients they've sent a message to (`to`, `cc`, _and_ `bcc`). I don't believe there is any known workaround for developers to access the `bcc` property of a Message while in the Sent folder.315Views2likes2CommentsAdd an OptionPane for add-ins preferences
In each Office Settings... having a add-ins section where all installed add-ins with a declared OptionPane would appear. Selecting the OptionPane would display it aside the list of add-ins with the one being displayed highlighted. In the OptionsPane, the add-ins would be able to have an interface to configure its parameters (For example, for a Zip based add-ins, the user would be able to set the compression method or the default compression level). Another example:for a filtering add-ins, you could select which mailbox or which folder it applies to. The declaration in manifest would be similar to TaskPane, but it would be displayed in a different context. TaskPane is a bad place for that and buttons is not a better place either. Settings should be in an unique place: Settings...Support for Split Button in ribbon
We need a way to declare a split button (an action button with a drop down menu accessible by clicking the down arrow next to the button. (like. the Flags split menu in Outlook (button can clear the flag while dropdown menu can select a flag). The manifest could be a menu with an ExecuteFunction at the item level. If an execute function is present, the rendering is a Split-Button otherwise it's a classic menu. A example taken from New Outlook for MacOS. The split button exists, but it's unavailable to office.js add-ins.[Word API] Document.compare: ability to specify Original and Revised document?
We're using the new Word.Document.compare() API, which is currently in preview (https://learn.microsoft.com/en-us/javascript/api/word/word.document?view=word-js-preview#word-word-document-compare-member(1)) . It seems it is not possible to specify what is the original and what is the revised document. It seems to assume the current document is the original, and the target document is the revised document See also this Github issue: https://github.com/OfficeDev/office-js/issues/4766206Views8likes3Comments