there is my current code, i cant find the selected shape:
Code: Select all
+F3::
oPPT := ComObjectActive("PowerPoint.Application")
SlideNumber := oPPT.ActiveWindow.Selection.SlideRange.SlideIndex
ShapesNum := oPPT.ActiveWindow.Selection.ShapeRange.SlideIndex ; this line goes wrong, others are right
oPPT.ActivePresentation.Slides(SlideNumber).Shapes(ShapesNum).TextFrame.MarginBottom := 0
oPPT.ActivePresentation.Slides(SlideNumber).Shapes(ShapesNum).TextFrame.MarginLeft := 0
oPPT.ActivePresentation.Slides(SlideNumber).Shapes(ShapesNum).TextFrame.MarginRight := 0
oPPT.ActivePresentation.Slides(SlideNumber).Shapes(ShapesNum).TextFrame.MarginTop := 0
oPPT.ActivePresentation.Slides(SlideNumber).Shapes(ShapesNum).TextFrame.WordWrap := False