Office Add-ins development
316 TopicsWorking with effects in shapes and textFrames in PowerPoint
We are modernizing our PowerPoint VBA add-in to Office.js. In our VBa add-ins, we have the following functionalities that we would like to implement in Office.js: Remove effects: Search for any shape and/or text “effects” such as bevels, glows, gradients, drop shadows, etc. Most effects will simply be removed. Find edits: Find any text with a font color changed to something that’s not a default in the template, all non-Arial font types, highlighted text and strikethrough text by looping through all shapes and shapes within shapes. Delete strikethrough: Find and delete all strikethrough text, with the exception of that within charts. We have explored the PowerPoint.TextFrame class and have found that there is a way to detect whether the contents of a placeholder are strikethrough or not. However, if a portion of the text is strikethrough, it will not be detected. For our use case, we would like to be able to detect all strikethrough even if the strikethrough is only present in some of the text. We would also like to grab and select the strikethrough text and then delete it. Can this be added? For the first two points, we have not been able to identify a way to achieve them.Create a table of contents in PowerPoint using placeholder text
We are modernizing our PowerPoint VBA add-in to Office.js. In our VBA add-in, we are able to generate a table of contents slide with slide numbers and links to those slides by reading the text in each slide's title placeholder. We have been exploring the PowerPoint preview API PowerPoint.PlaceholderFormat class for this use case. Using the placeholderFormat preview API, we can get the placeholder's type, i.e., determine whether it is a title and, using the textFrame.textRange.text property, get the placeholder's text content. We still do not have the ability to create a hyperlink. We intend to take a look at the 'bindings' feature when it becomes available to determine if it will meet our needs, but are there other available ways to achieve this?Extend Support for Border Manipulation Properties in Word Online
Hello Team, We are developing an Office Add-in that manipulates style border properties (e.g., outsideBorderType, outsideBorderWidth, and outsideBorderColor) to customize table and paragraph formatting in Word. Our testing shows that when running our code on the desktop version of Word these properties are populated and function as expected. However, when executing the same code in Word Online, the aforementioned border properties remain undefined. Reference to Documentation: We followed the guidelines provided in the Word.BorderCollection documentation, which indicates that this functionality is part of the [API set: WordApiDesktop 1.1]. Request for Clarification: Are these border manipulation properties intended to be supported in Word Online? If they are currently unsupported, are there any plans to extend this functionality to the online environment? Alternatively, if this behavior is unintended or represents a bug, could you provide guidance or recommended workarounds? Additional References and Test Project: To further illustrate the issue, we have prepared videos and screenshots demonstrating the differing behavior between Word Desktop and Word Online: StyleBorder_DesktopVersion.avi StyleBordersIssue-28-02-2025.avi Additionally, we have attached a test project (WordOnlineTest.zip) that reproduces the issue. To run the test project: Open the project in Visual Studio Code. Run npm install in the terminal. Run npm start. Thank you for your time and assistance. We look forward to your feedback, as resolving this issue would help ensure a consistent experience for our users across all platforms. Sincerely, BartPowerPoint.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.PowerPoint TextRange divide by formatting
If a TextRange has multiple formats (for example the first word is bold), it is currently not possible to get subTextRanges by the formatting. For example if I only want to replace the bold word in a textrange, I currently have to instruct the user to mark it, so I can replace the text in the selected TextRange. Let's say I have this text: This is an example with bold and italic text passages. What I need is to get a list of TextRanges. Let's say a method named `splitByFormatting()`. This would return a list of TextRanges: [ { text: "This is an ", ... } , { text: "example", ... } , { text: " with bold and ", ... } , { text: "italic", ... } , { text: " text passages.", ... } ] That way I can check what passage is the bold one and replace the text. Or I can have an programmatic overview over the formatting of the text.