powerpoint-vba

Resizing picture using Powerpoint vba

雨燕双飞 提交于 2019-12-12 17:17:48
问题 I am trying to resize a picture that I have pasted into powerpoint from Excel using powerpoint vba. My code says: ActivePresentation.Slides(9).Select Application.ActiveWindow.View.PasteSpecial DataType:=ppPasteEnhancedMetafile This part works fine, I am at a loss as how to then resize the picture in the next step. I am new to using powerpoint vba. Any help would be much appreciated. 回答1: Never select anything unless you absolutely must, and you very rarely must.. Get a reference to the shape

Connect to SQL Server from Powerpoint

懵懂的女人 提交于 2019-12-12 14:29:58
问题 This question was migrated from Software Engineering Stack Exchange because it can be answered on Stack Overflow. Migrated 8 years ago . How can I connect to a SQL DB from Powerpoint (be it 2007 or 2010) to generate reports? I've seen quite a few forums and most of them talk about using external tools. Check http://www.officekb.com/Uwe/Forum.aspx/powerpoint/34863/Linking-PowerPoint-to-a-database http://www.ljzsoft.com/pptreport/help/ppt-report-help.htm Isnt there any out of the box solution

VBA PowerPoint Online Guide and How to Record a Macro

末鹿安然 提交于 2019-12-12 13:52:09
问题 Could anyone recommend to me a good online guide to PowerPoint VBA? Also, does anyone has advice on how to record a macro in PowerPoint? 回答1: To record a powerpoint macro: In the menu bar, click on Tools Mouse over Macro > and the submenu will be displayed Click the Record button - a new toolbar will be displayed Do your thing Click the stop button on the new macro toolbar Click on Tools->Macro->Macros. Find the macro you just recorded and click the Edit button. That will show you what was

VBA fails when opening PowerPoint presentation on Windows 7

你。 提交于 2019-12-12 11:21:56
问题 I wrote a VBA macro in Excel 2007 on Windows XP to copy data from an excel spreadsheet into a powerpoint presentation. When this macro enabled spreadsheet was run on a fresh install of Windows 7 it fails. So I pulled out the code that fails to pin point the problem and it seems to fail when trying to open an existing powerpoint file. I have tried running this code in both Office 2010 and Office 2007. The code I am trying to use it (just the problem parts shown below) Sub test() Dim

VBA Powerpoint - Auto run on open and run in the background

寵の児 提交于 2019-12-12 09:59:31
问题 I'm trying to create a powerpoint presentation which will show the number of days since an injury in the workplace. When the presentation is first opened by the user i'd like a macro to run that prompts for a date to be entered since the last injury. So far for that i have this which appears to work ok:- Sub EveryDayAccidents() Dim injdate As String Dim lastdate As String Dim injfree As Integer Dim BnrMsg As String 'This Macro defines the latest injury date injdate = InputBox("Please enter

Create a new slide in VBA for PowerPoint 2010 with custom layout using Master

戏子无情 提交于 2019-12-12 08:02:45
问题 I have the following VBA code to create a new PowerPoint slide: longSlideCount = ActivePresentation.Slides.Count With ActivePresentation.Slides Set slideObject = .Add(longSlideCount + 1, ppLayoutTitle) End With ...which inserts a new slide of type 'ppLayoutTitle', but I am wondering if it is possible to create a custom layout in the 'Slide Master View' and then insert that particular slide template into the presentation? Thanks in advance!!! 回答1: All your custom layouts can be accessed via

Change cell fill color based on font color

孤人 提交于 2019-12-12 06:02:06
问题 I need to move conditionally formatted data from Excel 2013 into pre-existing tables in PowerPoint 2013. The font colors and formatting will carry from Excel to PowerPoint, but the cell fill needs to be manually added. Is it possible to create a macro in PowerPoint that will search through each table's cell, find one of five specific font colors "(xxx,xxx,xxx)", then fill that cell with a specified color? I have tables in Excel that have conditional formatting colors with the following rules:

Use VBA with Powerpoint to Search titles in a Word Doc and Copy Text into another Word Document

无人久伴 提交于 2019-12-12 03:36:51
问题 I'm working on a Powerpoint slide, where I few texts are listed. I have to search for these texts in a Word Document which has a lot of Headings and Texts. After I find the title text, I need to copy the text under the Heading and paste in a new document. Basically, the VBA coding has to be done in the Powerpoint VBA, with two documents in the background for searching text and pasting it in another. I've opened the word doc. But searching the text in it and selecting it for copying to another

Is there any unique ID associated with each Powerpoint presentation file (.ppt or .pptx)?

时光怂恿深爱的人放手 提交于 2019-12-12 03:15:53
问题 I have checked MSDN and there seems to be no unique ID (UUID or whatnot) property in the Presentation object model ( https://msdn.microsoft.com/EN-US/library/office/ff746640(v=office.15).aspx ) According to the code example, a Presentation can only be identified by a name only. e.g. Presentations("Sample Presentation").Slides.Add 1, 1 Is there anyway I can identify a presentation by way of an ID? Hopefully it will looks something like this Presentations("067e6162-3b6f-4abc-a171-2470b63dff00")

Executemso error after using it to post a chart from excel to ppt

坚强是说给别人听的谎言 提交于 2019-12-12 02:53:16
问题 I'm current using vba to automate the creation of a ppt report. I need to copy charts from excel and paste into ppt. I successfully used the ExecuteMso "PasteExcelChartSourceFormatting" to paste the chart in, which I need to use so I can paste while keeping the source formatting and embedding the workbook, but I keep getting an error after that when my code tries to reposition the chart in ppt. See code: Sub Update() Dim ppApp As PowerPoint.Application Dim ppPres As PowerPoint.Presentation