Project needs to do WinForm program and PowerPoint interaction, the WinForm generated images are automatically copied to the PPT. A simple service solution is currently being done using Python. Because the requirements are 32-bit programs, the following are all 32-bit versions.
The first step is to install python2.7 32-bit.
Second, install Py2exe 32-bit.
Step three, install Pywin32 32-bit.
Fourth step, write the code with Eclipse (Pydev plugin), see the attachment. The main contents are as follows:
wavy_ppt_service.py
Import socketserverimport win32com.clientimport sysclass mytcphandler ( Socketserver.baserequesthandler): "" " the requesthandler class for our server. It is instantiated once Per connection to the server, and must override the handle () method to implement communication to the client. "" " def handle (self): # self.request is the tcp socket connected to the  CLIENT        SELF.DATA = SELF.REQUEST.RECV (1024). Strip () # print "{} wrote:". Format (self.client_address [0]) # &Nbsp; print self.data # just send back the same data, but upper-cased# Self.request.sendall (Self.data.upper ()) application = win32com.client.dispatch ("PowerPoint.Application") currentSlide = Application.ActiveWindow.View.Slide currentslide.shapes.paste () host, port = "localhost", int (sys.argv[1]) #HOST, port = "localhost", 9999# create the server, binding to localhost on port 9999server = socketserver.tcpserver (( Host, port), mytcphandler) # activate the server; this will keep running until you#&Nbsp;interrupt the program with ctrl-cserver.serve_forever ()
It is a service that is done by the client and the server, and the server receives the data and copies the Clipboard pictures to the PPT.
Open cmd, call Buildexe32.bat can generate dist directory, contains the EXE program.
This article is from the "some" blog, be sure to keep this source http://2924037.blog.51cto.com/2914037/1692967
Use Python to do PPT services for importing pictures