![]() |
|
#4
|
|||
|
|||
|
PowerPoint vba doesn't really offer a convenient way to use ID like that.
The best solution is to write a custom function Code:
Function ShapeByID(ThisSlide As Slide, ThisID As Long) As Shape For Each ShapeByID In ThisSlide.Shapes If ShapeByID.Id = ThisID Then Exit Function End If Next End Function Code:
Sub exampleID() On Error Resume Next ShapeByID(ThisSlide:=ActivePresentation.Slides(1), ThisID:=8).Delete End Sub Code:
Sub DeleteByName()
On Error Resume Next ' in case shape doesn't exist
ActivePresentation.Slides(1).Shapes("MyName").Delete
End Sub
Last edited by JohnWilson; 04-14-2012 at 06:38 AM. |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Powerpoint automatically changing picture size when adding a picture (2010) | One_Life | PowerPoint | 7 | 01-20-2012 06:57 AM |
Picture size for Powerpoint
|
roligan | PowerPoint | 2 | 12-22-2011 07:18 AM |
Changing opacity of a picture on powerpoint
|
Straitsfan | PowerPoint | 1 | 05-18-2011 10:30 AM |
How to identify the paragraph number you are on
|
SaneMan | Word VBA | 1 | 05-18-2011 05:43 AM |
| PowerPoint 2003 - Change default location for Insert Picture | Fee | PowerPoint | 0 | 05-12-2011 02:15 AM |