View Single Post
 
Old 12-04-2023, 07:32 AM
JohnWilson JohnWilson is offline Windows 10 Office 2019
Programmer
 
Join Date: Nov 2008
Location: UK
Posts: 1,914
JohnWilson has a spectacular aura aboutJohnWilson has a spectacular aura about
Default

The code works fine here but why not just change the selected shape?

Code:
Sub ChangeDimensionsOfSelectedShape()
    Dim oshp   As Shape
    Dim newWidth As Integer
    Dim newHeight As Integer

    ' Set the new dimensions
    newWidth = 100 ' these do nothing
    newHeight = 50 ' these do nothing

    'set osld to currenht slide
    Set oshp = ActiveWindow.Selection.ShapeRange(1)
    With oshp
        ' Change the dimensions of the shape
        .Width = 930
        .Height = 428
        .Left = 15
        .Top = 77
    End With
End Sub
__________________
Microsoft PowerPoint MVP 2007-2023
Free Advanced PowerPoint Tips and Tutorials
Reply With Quote