PowerPoint: Difference between revisions
No edit summary |
mNo edit summary |
||
(5 intermediate revisions by the same user not shown) | |||
Line 13: | Line 13: | ||
** http://www.s-anand.net/blog/automating-powerpoint-with-python/ | ** http://www.s-anand.net/blog/automating-powerpoint-with-python/ | ||
** (http://www.shengdongzhao.com/shen_blog/how-to-automatically-create-powerpoint-slides-using-python/) | ** (http://www.shengdongzhao.com/shen_blog/how-to-automatically-create-powerpoint-slides-using-python/) | ||
<br> | |||
* <u>'''AutoIT'''</u> | |||
** | |||
<br> | <br> | ||
* <u>'''VBA'''</u> | * <u>'''VBA'''</u> | ||
** | ** http://www.pptfaq.com/FAQ00033_How_do_I_use_VBA_code_in_PowerPoint.htm | ||
** show slideid: | |||
<blockquote> | |||
<pre> | |||
Sub addID() | |||
Dim osld As Slide | |||
Dim oshp As Shape | |||
Dim i As Integer | |||
Call deleteID | |||
For Each osld In ActivePresentation.Slides | |||
Set oshp = osld.Shapes.AddTextbox(msoTextOrientationHorizontal, 10, 10, 100, 20) | |||
With oshp | |||
.TextFrame.TextRange = CStr(osld.SlideID) | |||
.Tags.Add "ID", "yes" | |||
End With | |||
Next osld | |||
End Sub | |||
Sub deleteID() | |||
Dim osld As Slide | |||
Dim i As Integer | |||
For Each osld In ActivePresentation.Slides | |||
For i = osld.Shapes.Count To 1 Step -1 | |||
If osld.Shapes(i).Tags("ID") = "yes" Then osld.Shapes(i).Delete | |||
Next i | |||
Next osld | |||
End Sub | |||
</pre> | |||
</blockquote> | |||
[[Category:Software/Microsoft Office]] | |||
[[Category:Software]] |
Latest revision as of 09:47, 13 September 2024
Generic Tips&Tricks
- select pane
Automated generation
- python-pptx
- pywin32
- http://sourceforge.net/projects/pywin32/
- http://metazin.wordpress.com/2008/08/12/how-to-work-with-powerpoint-files-in-python/ (pywin32)
- http://nbviewer.ipython.org/github/sanand0/ipython-notebooks/blob/master/Office.ipynb
- http://stackoverflow.com/questions/18670428/controlling-powerpoint-using-leap-motion-and-python
- http://www.s-anand.net/blog/automating-powerpoint-with-python/
- (http://www.shengdongzhao.com/shen_blog/how-to-automatically-create-powerpoint-slides-using-python/)
- AutoIT
- VBA
Sub addID() Dim osld As Slide Dim oshp As Shape Dim i As Integer Call deleteID For Each osld In ActivePresentation.Slides Set oshp = osld.Shapes.AddTextbox(msoTextOrientationHorizontal, 10, 10, 100, 20) With oshp .TextFrame.TextRange = CStr(osld.SlideID) .Tags.Add "ID", "yes" End With Next osld End Sub Sub deleteID() Dim osld As Slide Dim i As Integer For Each osld In ActivePresentation.Slides For i = osld.Shapes.Count To 1 Step -1 If osld.Shapes(i).Tags("ID") = "yes" Then osld.Shapes(i).Delete Next i Next osld End Sub