powerpoint

How to Differentiate SaveAs call and Save call in PowerPoint events?

佐手、 提交于 2019-12-11 12:11:12
问题 I'm writting AddIn for PowerPoint 2010. I'm using two functions of PowerPoint. Application_PresentationBeforeSave(ByVal Pres As Microsoft.Office.Interop.PowerPoint.Presentation, ByRef Cancel As Boolean) Application_PresentationSave(ByVal Pres As Microsoft.Office.Interop.PowerPoint.Presentation) When I perform Save operation (Ctrl+S) or SaveAs (File -> SaveAs) on powerpoint it executes Application_PresentationBeforeSave() method. But I need to differentiate these two calls (Ctril+S & SaveAs)

CommandBars.OnUpdate stops being fired

↘锁芯ラ 提交于 2019-12-11 11:26:18
问题 In my PowerPoint 2010 Addin I subscribed to the CommandBars.OnUpdate event to register movement of shapes and similar events: ppt = Globals.ThisAddIn.Application; ppt.CommandBars.OnUpdate += CommandBars_OnUpdate; This works great for some time. However, eventually the event stops being fired. Well, at least the registered event handler is not being called. I couldn't figure out, what causes this behaviour. It seems a bit indeterministic. No exception is thrown that would appear in the Debug

Print Powerpoint slide with python-pptx

一世执手 提交于 2019-12-11 10:38:47
问题 I've been using python-pptx to access slides (I find it much smoother than using win32 as it doesn't need to open the Powerpoint window. However, I've checked the docs but can't find any method of printing a slide. Am I missing something? Here is what I have so far: from pptx import Presentation prs = Presentation(path) for slide in prs.slides: if slide.name == slide_I_want: #send slide to printer 回答1: python-pptx (purposely) does not have a PowerPoint renderer, and so cannot print slides

Change Shape color in a loop VBA PPT

孤街浪徒 提交于 2019-12-11 10:35:11
问题 I need to change Colors of certain Shapes in a slide, based on the criteria if the shape is an EndConnectedShape of certain Connectors (the connectors are selected based on some data in a .txt file, but the data input part works fine). Although it must be straightforward, the part where I try to get the Shape by its Name is still not working: Sub test() Dim oFSO As FileSystemObject Set oFSO = New FileSystemObject Dim oFS As TextStream Dim i, j As Long Dim filePath, smth As String filePath =

How to update PowerPoint chart using c#

与世无争的帅哥 提交于 2019-12-11 10:27:03
问题 I have to update pptx file. In this pptx i have some set of chart which i have to update the data through c# code. Please let us know how to do it? Note: It is not OLE graph, it is power point chart component Thanks in advance 回答1: In VBA syntax it's something like For i = 1 To ActiveWindow.Selection.ShapeRange.Count If ActiveWindow.Selection.ShapeRange(i).Type = msoChart Then Dim c As Chart Set c = ActiveWindow.Selection.ShapeRange(i).Chart Dim data As ChartData Set data = c.ChartData data

Displaying PowerPoint Slides in Objective-C

杀马特。学长 韩版系。学妹 提交于 2019-12-11 10:21:11
问题 I would like to ask if it is possible to display PowerPoint through either TableViewController or UIButton instead of using a UIWebView? The PowerPoint Slides are being stored in a folder in Xcode. 回答1: I don't know what you're envisaging with a UIButton, that makes very little sense to me, but you can of course put a UIWebView in a table cell. I assume that's not what you want? You're probably best off pre-processing the PowerPoint files on a back-end server to convert them to PDFs. (or as

Detect text language in VBA

拈花ヽ惹草 提交于 2019-12-11 10:18:11
问题 I have a textbox in PowerPoint which I store into an array with Split. Is there any way to detect what language the text is in VBA? There will actually only be English or Chinese text, so I guess an alternative solution would be to detect if the text is not English, or is/isn't Unicode? 回答1: It should be possible by checking that one of the characters is Chinese: Function IsChiness(text As String) As Boolean Dim c&, i& For i = 1 To Len(text) c = AscW(Mid$(text, i, 1)) If c >= &H4E00& And c <=

Unable to see Apache POI updated data value in BarChart in pptx without editing

风流意气都作罢 提交于 2019-12-11 10:10:40
问题 I have a pptx template, it has just 1 slide for testing purpose. The slide has a simple bar chart. I am able to edit the bar chart by double clicking it on pptx file and I could change the values in Sheet1 (Data sheet for Barchart), and, I able to see the changes immediately in BarChart. Now, I am trying to do the same using POI API. I am doing the below steps here Read the template file = "MyTemplate.pptx" - https://docs.google.com/file/d/0B-q0lBy0lKLic3dCSUVsZUdGQzA/edit?usp=sharing Have

How to keep original text formatting of text with python powerpoint?

放肆的年华 提交于 2019-12-11 09:27:52
问题 I'd like to update the text within a textbox without changing the formatting. In other words, I'd like to keep the original formatting of the original text while changing that text I can update the text with the following, but the formatting is changed completely in the process. from pptx import Presentation prs = Presentation("C:\\original_powerpoint.pptx") sh = prs.slides[0].shapes[0] sh.text_frame.paragraphs[0].text = 'MY NEW TEXT' prs.save("C:\\new_powerpoint.pptx") How can I update the

Textbox with rounded corners using VBA

让人想犯罪 __ 提交于 2019-12-11 09:19:29
问题 I have a predefined textbox in a PowerPoint slide, I need to make its corners rounded. Is there any way I can do this using VBA? 回答1: This example assumes that the shape you're after is the third shape on slide 1. Adjust accordingly: Sub Test() Dim oSh As Shape Set oSh = ActivePresentation.Slides(1).Shapes(3) With oSh .AutoShapeType = msoShapeRoundedRectangle .Adjustments(1) = 0.25 End With End Sub It converts the textbox to a rounded rectangle then sets the corners to be rounded. As far as I