powerpoint

Using C# & Powerpoint OpenXML, is it possible to change the font size and color of text

我的梦境 提交于 2019-12-08 16:38:03
问题 I am using openXML and C# to generate a powerpoint slide but I can't seem to figure out how to change / set the text size and color. Is this possible and are there any example as I can't seem to find any with googling? I am building out a table (similar to this: http://blogs.msdn.com/b/brian_jones/archive/2009/08/13/adding-repeating-data-to-powerpoint.aspx) and I want to change a number of things in each cell (fontsize, font color, backcolor of cell). 回答1: Your comments state this Formatting

How to find and replace a string in powerpoint using VBA

安稳与你 提交于 2019-12-08 15:26:37
问题 I would like to replace the word "hello" with "world" on slide 1 of the ppt. How can I do that using VBA script. 回答1: Sub findAndReplaceText() Dim sld As Slide Set sld = ActivePresentation.Slides(1) Dim shp As Shape For Each shp In sld.Shapes If shp.HasTextFrame Then If shp.TextFrame.HasText Then shp.TextFrame.TextRange.Text = Replace(shp.TextFrame.TextRange.Text, "hello", "world") End If End If Next shp End Sub Reference: https://www.youtube.com/watch?v=BYfKvVmtAGE 回答2: In a slight addendum

Saving a PowerPoint in Excel VBA

好久不见. 提交于 2019-12-08 13:25:25
问题 I have code that creates a new powerpoint consisting of some images from an excel file. I want to save the file using a string variable to define its name. I've done my due diligence searching for solutions with no success, which surprises me based on how basic of a task I'm trying to complete. As of now, I have... newPowerPoint.ActivePresentations.SaveAs filenamestring, 1 newPowerPoint.ActivePresentations.Close But I keep getting a whole host of error messages. I have newPowerPoint defined

Add plots in PPTx without crashing R using addplot()

早过忘川 提交于 2019-12-08 13:11:00
问题 I tried to add my C50 tree plot to ppt from R. (ps: not R markdown) However, I am not sure if its because the plot size was too large or not, everytime I ran the code as below, it crashed my R studio. I even tried the code without re-sizing the plot (where I put # to not include that part of code) but it did not work. I tried to add the plot to PDF and it worked and it was clearly displayed. But I really need to figure out a way to put it into the PPTX. Sorry I cannot show you guys the tree

Writing Excel VBA code/macro to populate Powerpoint Text boxes with Excel cell values

不问归期 提交于 2019-12-08 11:54:26
问题 I am attempting to take the value in Excel cells and populate PowerPoint text boxes. I don't want to link a PowerPoint table to an Excel spreadsheet because the spreadsheet is constantly changing and values are not always in the same rows or the same order. So I am writing this VBA code to try and populate the text boxes. I've done a lot of VBA, but never attempted this combination. Below is what I have thus far (more code will be put in for additional text boxes, but need to get one working

Macro to change Shape Colour on Mouse Hover in PowerPoint

人走茶凉 提交于 2019-12-08 11:20:45
问题 Is it possible to change the shape color on mouse hover using VBA in PowerPoint? I tried creating the same effect using animations+trigger but it requires a click. However I would like to change the shape color as I hover the mouse over it and change it back to the original color as I hover the mouse to next shape. Is this possible to achieve? Thanks in advance. 回答1: This is possible with a hack approach to overcome the fact that PowerPoint doesn't support the mouse-out event. What you can do

Any VBA code to align the picture from PowerPoint?

◇◆丶佛笑我妖孽 提交于 2019-12-08 08:55:55
问题 I have a PowerPoint document with 239 slides. I have to align the picture from every slide making the following two steps: 1. Right click and select Edit Picture 2. Then Press YES My question: Is there any macro (vba code) to do all this job automatically? Thanks! 回答1: Microsoft stores complex vector objects in WMF or EMF formats and in order to edit them one needs to convert them to native MSO drawing objects (vectors). The process to do this is to ungroup them and this code will do it for

WebBrowser shortcuts not working in PowerPoint add-in… but WebBrowserShortcutsEnabled is true

我的梦境 提交于 2019-12-08 08:52:22
问题 I'm building a powerpoint add-in that is going to be based around an embedded browser. For some reason, though, the standard shortcuts don't work. The WebBrowserShortcutsEnabled property is set to true (though I even got as far as trying setting it to false in case I was in backwards world). Stripping it down to the bare bones, my repro steps are: Create a new project, selecting the PowerPoint 2013 Add-in project type Add a new User Control to the project Add a WebBrowser to that control,

Paste Unlinked Excel Chart to Powerpoint

試著忘記壹切 提交于 2019-12-08 08:30:24
问题 I'm currently working on a project transferring 50+ groups of Excel Charts to a powerpoint presentation. I have 50+ items that I'm comparing and making 50+ identical charts. The way that I have it set up in my excel workbook is that the chart is always the same chart (ie Chart 2), but by changing a unique ID number, my chart will source from a different area of the worksheet. In the usual case, I would just copy and paste the chart as a picture. However, in my case, I also need to get rid of

Getting “Cannot Run the Macro…” Error in VBA

穿精又带淫゛_ 提交于 2019-12-08 07:52:56
问题 I recently learned how to program in VBA and have gotten some extremely helpful assistance by reading through the previously asked questions and answers on this site. However, I have encountered a problem in one of my programs that doesn't appear to be addressed very directly. So I'll ask it here. I am making a Powerpoint macro that will automatically update some slides with new data. For one slide that contains an excel table, I want the macro to open up an excel file, run an existing macro