powerpoint

Python-pptx - Text parameters (font, size, position) on Autoshape

假如想象 提交于 2019-12-10 21:54:16
问题 How can I set font, size of text for the shape ? One Object instead two seperate ones (shape and Text, how use run for the shape) Just do not get how to set the parameters on Textframe instance of the Autoshape-object. from pptx import Presentation from pptx.enum.shapes import MSO_SHAPE from pptx.enum.dml import MSO_THEME_COLOR from pptx.enum.text import MSO_ANCHOR, MSO_AUTO_SIZE from pptx.util import Inches, Pt prs = Presentation('Input.pptx') slide_layout = prs.slide_layouts[2] slide = prs

Handling key events on WebBrowser control?

风流意气都作罢 提交于 2019-12-10 19:54:23
问题 Currently I am using an application which play ppt and flash in WebBrowser Control. In WebBrowser I am able to hide context menu by using this.IsWebBrowserContextMenuEnabled = false; and capture key event by using this.PreviewKeyDown += new PreviewKeyDownEventHandler(IWebBrowser_PreviewKeyDown); but while playing the ppt , both context menu and keypress events are not functioning i.e. I can see context menu and arrow key force the ppt to change the slide. Again while playing flash, context

create new pptx using existing pptx Python-Pptx

冷暖自知 提交于 2019-12-10 18:51:26
问题 I am trying to create new.pptx using an old.pptx . old.pptx is having 4 slides in it . I want to create the new.pptx with almost same content with few text modifications in 4 slides . I skipped the modification part from the below code, you can take an example like converting lower cases to upper case..Need to do these things in run time, so that if i just pass the old.pptx it will do the required operation and then write it to new pptx with same no. of slides..I am not sure how to tweak

How to cancel the close event for PowerPoint like in Word & Excel in PIA?

Deadly 提交于 2019-12-10 17:30:18
问题 When Microsoft Word is closed, the close event can be canceled. The same is for Excel. But the PowerPoint close event doesn't have cancel flag. Is it possible to cancel the event in any other way? 回答1: In the close event you can set the document to Saved = False , this will force PowerPoint to ask the user if he wants to save the file with a Yes-No-Cancel message box. Using SendKeys({ESC}) just before the end of the event, it will send escape to the message box, and the close event will be

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

Powerpoint Interop fails in a Windows Service but works fine in a Windows Form application

≡放荡痞女 提交于 2019-12-10 17:16:16
问题 I've written an application to watch a folder, and whenever a PowerPoint document is dropped into it, it goes through the slides within it and generates png images of each slide. This works fine in a windows forms application but I've put exactly the same code in a windows service, used the same test file and it fails to open it with the following error: Error: PowerPoint could not open the file. at Microsoft.Office.Interop.PowerPoint.Presentations.Open(String FileName, MsoTriState ReadOnly,

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

How to update embeded excel links in powerpoint 2010 using vba

孤街醉人 提交于 2019-12-10 16:04:08
问题 My problem is i have pasted my charts into powerpoint and I am trying to update the embedded links via Excel-VBA. I have tried the codes below and failed: code 1 AppPPT.Presentations.Open "D:\Demo.pptx", Untitled:=msoTrue AppPPT.ActivePresentation.UpdateLinks AppPPT.ActivePresentation.SaveAs "D:\Demo.pptx" code 2 For i = 1 To AppPPT.ActivePresentation.Slides.Count For s = 1 To AppPPT.ActivePresentation.Slides(i).Shapes.Count If AppPPT.ActivePresentation.Slides(i).Shapes(s).Type =

PowerPoint Notes in C#

≡放荡痞女 提交于 2019-12-10 15:34:47
问题 I want to read the notes of a PowerPoint Slide in C#. Following Snippet works for me. slide.NotesPage.Shapes[2].TextFrame.TextRange.Text However, this doesn't work for some presentations. Then it throws an "Out of range" exception. What ist the meaning of index 2? Are there any alternative to do this? 回答1: You can't assume that the notes text placeholder will be at any specific index or even that it'll have a specific name. Here's a simple function in VBA that returns the notes text