powerpoint-vba

How to apply particular layout in powerpoint using vba?

血红的双手。 提交于 2019-12-17 16:28:54
问题 I am working on one project. In that I made one custom theme which includes one master slide and may layouts. so basically i want to apply particular layout to specific slides. So is there any way to do it by programmatically. like : activepresentation.Slides(1).Layout="layoutname" I know above code is wrong but i want something like this to call particular layout by its name. for your information my layout name is "Title without Client Logo". Thanks 回答1: ActivePresentation.Slides(1)

Get Layout Shape Corresponding to Slide Shape

社会主义新天地 提交于 2019-12-14 03:55:09
问题 In PowerPoint 2007 and using VBA, how can I get the placeholder shape on a Slide Master layout that is the "master" for a placeholder shape on the slide? I am currently using a loop to compare the position and size of the slide placeholder with the position and shape of each placeholder shape in the slide's layout, but this isn't fool-proof. For example, if the placeholder shape is moved on the slide, its position may no longer match the position of any placeholder shapes in the slide's

Add PowerPoint slide to textbox with CommandButton VBA

拈花ヽ惹草 提交于 2019-12-14 03:14:54
问题 I have a command button and a text-box in the Slide Master of a PowerPoint presentation. I am trying to retrieve the PowerPoint's properties such as SlideID, SlideIndex and the name of the corresponding file and post them to the text box on the click of the command button. At the moment I have this code but its giving me an error: Sub CommandButton1_Click() Dim Index As Long Dim SlideId as Long Dim FileName as String TextBox1.Text = "SlideIndex:" & Index & "Slide ID:" & SlideId End Sub I want

How to modify text in Powerpoint via Excel VBA without changing style

末鹿安然 提交于 2019-12-13 21:34:02
问题 I am trying to replace a set of tags in the text of a powerpoint slide from Excel using VBA. I can get the slide text as follows: Dim txt as String txt = pptSlide.Shapes(jj).TextFrame.TextRange.Characters.text I then run through replacing my tags with the requested values. However when I set do pptSlide.Shapes(jj).TextFrame.TextRange.Characters.text = txt Problem: All the formatting which the user has set up in the text box is lost. Background: The shape object is msoPlaceHolder and contains

Create add-in to add sticky notes in powerpoint (VBA)

谁说胖子不能爱 提交于 2019-12-13 16:29:17
问题 I would like to create a simple macro for powerpoint that would allow me to click on one button to automatically insert a yellow sticky note onto my slide so I can insert a comment. This is something I need to do over and over in my current job and right now I am wasting a lot of time, each time creating a rectangle -> coloring it yellow -> creating a black outline -> setting font color to red and size to 12.. Appreciate any help here, I know it should not be very hard! Thanks! example of

Open Excel file in VBA from Powerpoint

青春壹個敷衍的年華 提交于 2019-12-13 12:08:39
问题 I'm trying to open the Excel file using VBA in Powerpoint 2010 with the help of following code. Private Sub CommandButton1_Click() Dim xlApp As Excel.Application Set xlApp = CreateObject("Excel.Application") xlApp.Visible = True xlApp.Workbooks.Open "C:\lol\Book1.xlsx", True, False Set xlApp = Nothing Range("A8").Value = "Hello" End But I'm getting the following error. Compile Error User Defined type not defined. Am I missing something. Can anyone share the sample piece of code to open an

How to show a waiting dialog, in the meantime, still keep dealing with PowerPoint objects?

白昼怎懂夜的黑 提交于 2019-12-13 07:30:58
问题 I want to show a waiting dialog, in the meantime all the calculations concerning with PowerPoint objects still are running in the background. My purpose is during the time dealing with PowerPoint objects, I try to prevent the user from interfering with the UI. It seems that there is no way to deal with PowerPoint objects in the background. Is there any workaround for my case? Thanks Note: I am using VS Ultimate 2013, C#, PowerPoint 2013, vsto 回答1: Office applications use the single threaded

Excel VBA Error 467 when trying to open a PowerPoint presentation

旧时模样 提交于 2019-12-13 06:52:21
问题 Objective of the Code : if PowerPoint is open and the searched Presentation is open, then update it. If the presentation is closed, then open it. In case PowerPoint is closed, then create a new instance. Error : after multiple users have ran it on on mulitple computers the past 2 weeks, today one of the users get the following error message: Run-Time Error 467: The Remote Server machine does not exist or is unavailable Line code highlightned on debug mode : Set ppPres = ppProgram

Auto resize cells within table

浪子不回头ぞ 提交于 2019-12-13 06:50:21
问题 How do I auto resize the column width or row height in a PowerPoint table? Edit: I am working with PowerPoint 2010 and I wanted something like: Sub table_fix() Dim icol As Integer, irow As Integer, minW As Single, minH As Single With ActiveWindow.Selection.ShapeRange(1).table For icol = 1 To .Columns.Count For irow = 1 To .Rows.Count With .Cell(irow, icol).Shape.TextFrame If minW = 0 Then minW = .TextRange.BoundWidth + .MarginLeft + .MarginRight If minW < .TextRange.BoundWidth + .MarginLeft +

How to provide VBA access for a modify password protected read only PowerPoint file?

和自甴很熟 提交于 2019-12-13 06:20:56
问题 I’m trying to create a free non-editable version of a PowerPoint slide that demonstrates how VBA can be used to make a slide very dynamic. The slide is an interactive stopwatch and there is a video of it here: http://i-present.co.uk/free-stuff/free-powerpoint-stopwatch/ VBA is used to modify various shapes on the slide based on the Windows API timer. In the free version, I want the VBA functionality to run but set the presentation up so that the slide objects cannot be edited. This is what I