powerpoint-vba

Determining if a powerpoint text box is over the page size

天涯浪子 提交于 2019-12-13 05:47:44
问题 I've been researching this for a while and have not found any background on whether Powerpoint VBA can determine if an object (text box or table) is outside the bounds of the page dimensions. The specific application I am trying to manage is when I flow text into a PPT table from Excel, through a find/replace of specific data markers, I don't know the specific dimensions of the text, so I may overflow the page boundary. I cant shrink the text either, as I have to maintain the design fidelity

Commandline switch/macro for Powerpoint 2010

时光毁灭记忆、已成空白 提交于 2019-12-13 04:09:52
问题 Is there a switch or a general macro (that can be applied to any ppt file) to save a ppt file to png files? 回答1: No, there is no commandline switch for this. There are two possible options with switches though, one is /M (macro), which means you can run a macro in your PPTX (and that macro could save to .PNG) or /PT (print to) and print to OneNote (if you have it) and those images will be PNG. See Command-line switches for PowerPoint 2007 (which are the same as 2010) for more details. A macro

How to replace image of a picture shape in PowerPoint?

天涯浪子 提交于 2019-12-13 03:34:28
问题 Is there any way to replace the image of an existing picture shape in PowerPoint from code? Thanks 回答1: If it's a linked image, either overwrite the linked image file with a new file or point the link at a new file. Or if the shape is picture filled, you can fill it with a different picture instead. That can distort the picture if its proportions don't match the shape's proportions; instead, you can change the aspect ratio of the shape to match that of the picture if need be. To change the

Automate Powerpoint Macro

血红的双手。 提交于 2019-12-13 02:35:41
问题 I have a PowerPoint Presentation that gets filled with pictures by a VBA script attached to it. I want to automatically open the Presentation and run the macro. Here's what I have tried: turning the script into an add-in as shown here: it ran when I clicked activated it, but never when I simply opened powerpoint. downloaded a pre-built add in, and called my script sub auto_open(). This worked, but because it is a macro enabled file(?), but I have to open powerpoint up and enable the add in

How to adjust export image size in PowerPoint using vba?

穿精又带淫゛_ 提交于 2019-12-13 02:13:32
问题 I'm creating a macro in PowerPoint VBA to export an image from the current slide. The export image will be the first image having a width larder than 250 units. The image is stored as a Shape , so I do a For Each ... Next loop to do it. The code works fine. Function FindAndSavePicture() As String ' ' Find the target picture at the active windows ' ' Dim myTempPath As String myTempPath = "C:\Users\" & Environ$("USERNAME") _ & "\AppData\Local\Microsoft\Windows\pic_VBA.jpg" With ActiveWindow

PowerPoint 2007/2010 VBA code to change Type of Gradient Fill on a Shape object

我与影子孤独终老i 提交于 2019-12-13 01:35:02
问题 With PowerPoint 2007 & 2010, I have been trying to change the Type of Gradient Fill on a Shape object from default "Rectangular" to "Path" for days. Searched online but seems like no such question asked. So far I can only get the Gradient Fill to be "Rectangle" (the default with 2 color gradient?). But I want it to be "Path". So far only able to do that by right click on the actual Shape --> Format Shape. "Format Shape" form shows and I can change the "Type:" from Rectangle to Path. But I

Loop Through Charts on Selected (or Range of) Powerpoint Slides

倖福魔咒の 提交于 2019-12-13 00:45:52
问题 I am currently using this code to update all links in my powerpoint presentation: Sub UpdateLinks() Dim ExcelFile Dim exl As Object Set exl = CreateObject("Excel.Application") ExcelFile = "C:\Users\J\Documents\Reporting\Governance Physical Charts.xlsm" Dim i As Integer Dim k As Integer 'Go through every slide For i = 1 To ActivePresentation.Slides.Count With ActivePresentation.Slides(i) 'Go through every shape on every slide For k = 1 To .Shapes.Count On Error Resume Next 'Set the source to

How to refresh the active Slide in a slide show?

喜夏-厌秋 提交于 2019-12-12 19:33:38
问题 Based on my last question I got the right code to change the image of an shape. Unfortunatly, this does not update the active Presentation. If I close the presentation and restart it, the image is changed, but the change should be directly visible. This is my code to change the image: ActivePresentation.SlideShowWindow.View.Slide.Shapes("SolutionA_Image").Fill.UserPicture ("D:\User\SolutionWrong.jpg") I found a way to update the presentation, but this lets the presentation flicker.

PowerPoint Interop Assemblies Slowness Issue

随声附和 提交于 2019-12-12 19:13:40
问题 I'm using MS Office interop assemblies to build a Powerpoint addin that inserts slides and charts on the fly. But during insertion it take up to 20 seconds to complete the process from inserting the slide to insertion of the chart. After doing extensive logging, I noticed few lines of code where our application gets stuck for 20+ seconds. Here are those lines: powerpointChartObj.SetSourceData(Source:=String.Format("=Sheet1!A1:B{0}", 5)) powerpointSlideObject.Shapes("some shape name") We

how to add a textbox to a powerpoint presentation using vba

萝らか妹 提交于 2019-12-12 18:27:20
问题 I'm writing a macro which creates a powerpoint presentation and then copys data from a spreadsheet and adds a title and a textbox. I've been able to add the data and tile and format both however I'm struggling to add a textbox. When I run the code below it returns the error 'ActiveX component can't create object'. I feel like over looking something simple. Any help would be greatly appreciated! (Error occurs on the line after the first set of '-------') Sub Create_Presentation() Dim rng As