473,770 Members | 1,995 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

PowerPoint and python

1 New Member
Hi,

I'm developing a software in Python that communicates with Powerpoint files. My application has to open the Microsoft Powerpoint 2003 and a file .ppt format and show the presentation.
The problem is that i started to code the pyhton script, but when i execute it, it only opens the powerpoint 2003 (Microsoft) without open the presentation file (.ppt). ANybody knows if it has a bug at pywin ?

this is the code:

import win32com.client
ppt = win32com.client .Dispatch("Powe rpoint.Applicat ion")
ppt.Visible=1
pr=ppt.Presenta tions.Open('C:\ temp\porra.ppt' )
Jan 24 '07 #1
1 8992
bartonc
6,596 Recognized Expert Expert
Hi,

I'm developing a software in Python that communicates with Powerpoint files. My application has to open the Microsoft Powerpoint 2003 and a file .ppt format and show the presentation.
The problem is that i started to code the pyhton script, but when i execute it, it only opens the powerpoint 2003 (Microsoft) without open the presentation file (.ppt). ANybody knows if it has a bug at pywin ?

this is the code:

import win32com.client
ppt = win32com.client .Dispatch("Powe rpoint.Applicat ion")
ppt.Visible=1
pr=ppt.Presenta tions.Open('C:\ temp\porra.ppt' )
Try
Expand|Select|Wrap|Line Numbers
  1. import win32com.client
  2. ppt = win32com.client.Dispatch("Powerpoint.Application")
  3. ppt.Visible=1
  4. pr=ppt.Presentations.Open(r'C:\temp\porra.ppt')
  5.  
which uses 'r'aw strings for windows path names. Otherwise python sees "\t" which is a tab character.
Jan 24 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
7274
by: Greg Wilson | last post by:
Hi. Has anyone ever written scripts to extract data from PowerPoint using Python? I know I could dredge through the VB examples in MSDN, and translate, but if someone's already done this, I'd be grateful for a few examples. (I have slides done in PPT that I want to convert to simple HTML --- using "Save as HTML" in PPT creates a lot more goo than I want to have to wade through.) Thanks, Greg
23
2565
by: anton.vredegoor | last post by:
Here's my situation: I'm typing this in a public library on a computer with OS windows 2000 server. I can run Internet explorer, word, excel and powerpoint, that's it. Maybe java, but it seems to be flaky. I want to run python scripts from this computer. At home I have a multi-computer network (from better times) but no internet access anymore, I could use this to try out solutions. I also have access to a friends computer which has...
0
568
by: Ata | last post by:
Hello, I am trying to copy the contents of the output of SQL Reporting Services to a PowerPoint slide. For this, I am using SQL Reporting Services to obtain an IMAGE stream, which I paste to the Windows clipboard. Then, using automation, I am trying to copy this information from the clipboard to a PowerPoint slide. However, I get an error at slide.Shapes.PasteSpecial. I am able create a System.Drawing.Bitmap object from the memory...
6
3410
by: C Williams | last post by:
Hi, I am writing some VB.NET code that compiles to a dll. There is some code within it that manipulates Powerpoint 2003. The dll I am writing is for smart tags, and I am having trouble because sometimes Powerpoint is remaining running (powerpnt.exe in Task Manager). One action of my smart tags calls InsertChart (code below). The designated line causes powerpoint to remain running even after the user has manually closed the...
8
7077
by: Rut | last post by:
Does anyone know how to start powerpoint from vb.net without the ppt screen appearing. I want to keep it hidden? Using this code: Try pp = New PowerPoint.Application pp.Visible = Office.MsoTriState.msoTrue pp.WindowState = PowerPoint.PpWindowState.ppWindowMinimized Application.DoEvents()
4
7954
by: michael.pearmain | last post by:
Hi Experts, Looking for a very quick bit on of advice on how to make some python code run. I'm a newbie to both VBA and Python, so i apologise if this is very easy but i'm about to tear my hair out after googling for the last 3 days. I have written a large python script which inside of it creates an Excel table, the name of this file and how many objects can change for each project i run.
6
4465
by: Alan Isaac | last post by:
Can someone point me to a simple example or better yet tutorial for creating a Powerpoint using Python. Thanks, Alan Isaac
1
11903
by: chrizstone | last post by:
Hi Guys, What i want to do is: I want to create a Slide programmatically where a Table is on it! Here´s my Code: String strTemplate; strTemplate = template; String tableSlide = @"C:\Temp\TableSlide_" + guid.ToString();
0
9618
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10260
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10101
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9906
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8933
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6712
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5482
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3609
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2850
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.