powerpoint-vba

Powerpoint VBA - Passing RGB colors as a variable

夙愿已清 提交于 2019-12-11 03:04:49
问题 I want to allow users to enter in a RGB color via a text box and pass that variable to change the colors of all shapes. I wrote a loop that would look at the last 2 characters of the shape name to determine if it should be changed to the primary or secondary color. This is for powerpoint from the latest office 365. I've tried the following codes. I am getting either an type mismatch or invalid argument error: Dim osld As Slide Dim oshp As Shape Dim strMainColor As String, strSecondColor As

VBA save Presentation as PDF in Handout 2x2 format Office 2007

*爱你&永不变心* 提交于 2019-12-11 03:04:45
问题 I'm trying to save a PowerPoint presentation using VBA, and I want to save it as a .pdf in Handout format with 2x2 slides on a page. Can somebody tell me or point me to a link that tells me how to do it. I've done my homework on Google, but couldn't find it. Any help/suggestions/hints will be appreciated. I've tried searching the reference too, but I only reached the ppSaveAsPDF , which is anyway accessible from the VBE IntelliSense. But I don't know how to achieve the handout 2x2 part. 回答1:

Error Getting .OLEFormat.Object property of PowerPoint Shape (LateBinding from Excel-VBA)

别等时光非礼了梦想. 提交于 2019-12-11 01:49:54
问题 I have an Excel VBA tool, that resides inside a PowerPoint Presentaion as an EmbeddedOLEObject. Process work-flow: A user opens the PowerPoint. Then opens the Excel embedded object in it. Running the code in it updates data in the Excel file, and then exports it to the 1st slide of the PowerPoint it was opened from. The problem starts when the user opens 2 of these PowerPoint presentations. If you open one Presnetation, let's call it " P1 ", then you open a second presentation " P2 ". Then

progress through powerpoint with macros not working on second slide

女生的网名这么多〃 提交于 2019-12-11 01:30:03
问题 I'm trying to create a macro which will run through slides in a powerpoint presentation. I had it working, but now it has stopped working and I don't know why. The vbscript to run through the slides and animation are Private Sub PPTEvent_SlideShowNextBuild(ByVal Wn As SlideShowWindow) Sleep 1000 SendKeys "{RIGHT}" End Sub Private Sub PPTEvent_SlideShowNextSlide(ByVal Wn As SlideShowWindow) Sleep 1000 SendKeys "{RIGHT}" End Sub Is there a better way to accomplish this? I can't see where the

Find and Highlight Text in MS PowerPoint

喜夏-厌秋 提交于 2019-12-11 01:17:59
问题 I used some code from this site to make a macro to do a keyword search on Word docs and highlight the results. I would like to replicate the effect in PowerPoint. Here is my code for Word. Sub HighlightKeywords() Dim range As range Dim i As Long Dim TargetList TargetList = Array("keyword", "second", "third", "etc") ' array of terms to search for For i = 0 To UBound(TargetList) ' for the length of the array Set range = ActiveDocument.range With range.Find ' find text withing the range "active

vba hyperlinks and shape creation

若如初见. 提交于 2019-12-11 00:28:49
问题 I have a subroutine that will create a shape, but I have two problems with the code: I must specify on which slide this shape will be created. This is a problem if I want to create the same shape on multiple slides simultaneously. How do I achieve that? what do I replace activepresentation.slides(x) with? I want the shape to have a hyperlink to a specific slide. What is wrong with my code to achieve that? It gives me an error when I try to assign an action to the shape I have created. Sub

Shapes.AddOLEObject method not working in PowerPoint 2013 (32bit and 64bit)?

六月ゝ 毕业季﹏ 提交于 2019-12-10 22:46:17
问题 I am using the following code to add web browser control to PowerPoint slide, Set oShp = oSld.Shapes.AddOLEObject(Left:=100, Top:=100, Width:=200, Height:=300, Classname:="Shell.Explorer", Link:=msoFalse) The above code works fine in all PowerPoint versions except PowerPoint 2013 (32bit and 64bit) . I get the following error message, In PowerPoint 2010 (32bit and 64bit) the web browser control is added but the control is black until viewing it in Slide Show. Then it gets refreshed. How to fix

Editing Embedded PowerPoint from Excel VBA

最后都变了- 提交于 2019-12-10 17:25:52
问题 I have an embedded PowerPoint presentation in an Excel workbook. How can I edit this (open, copy slides, add data to slides, close) using VBA? 回答1: 1. Add a reference to the PowerPoint Object Model to your VBA application From the VBA window, choose Tools | References Look for Microsoft Powerpoint 12.0 Object Library and check it 2. Select and activate the PowerPoint presentation object ActiveSheet.Shapes("Object 1").Select Selection.Verb Verb:=xlOpen Note: this code assumes that the

Get shape Id by Name

与世无争的帅哥 提交于 2019-12-10 17:10:46
问题 Is there any way to get a shape's Id if you know it's Name ? For example, if I have this: Dim myshape As Shape myshape.Name Can I get it's Id ? myshape.Id = getIdByName(myshape.Name) 回答1: Sure, it's pretty straigtforward: Sub PrintShapeID() Debug.Print getIDByName("My Shape", 1) End Sub Function getIDByName(shapeName As String, slide As Integer) Dim ap As Presentation: Set ap = ActivePresentation Dim sl As slide: Set sl = ap.Slides(slide) Dim sh As Shape: Set sh = sl.Shapes(shapeName)

Programmatically save as PowerPoint 2007 (pptx), from PowerPoint 2003

痞子三分冷 提交于 2019-12-10 16:34:31
问题 I need to be able to save Presentations (programatically) in PowerPoint 2003 as OpenXML (".pptx"). I installed the Microsoft Office Compatibility Pack. This indeed allows me to perform "Save as PowerPoint 2007 Presentation" from PowerPoint 2003. How can I do this programmatically? (e.g. VBA) I tried Presentation.SaveAs : While there is no inherent PpSaveAsFileType enum value in PowerPoint 2003 for ppSaveAsOpenXMLPresentation , I made a program which prints the PpSaveAsFileType values and