![]() |
|
|
|
#1
|
|||
|
|||
|
Did you select a shape?
|
|
#2
|
|||
|
|||
|
No, I don't want to select the shape
I want just select the slide and run the code. However, Mr. Jhon, I think the problem is with my file, because I made a new file and run your previous code and works perfectly Code:
Sub ChangeDimensionsOfSecondShape()
Dim osld As Slide
Dim shapeIndex As Integer
Dim newWidth As Integer
Dim newHeight As Integer
'Edit mode only!
' Set the new dimensions
newWidth = 100
newHeight = 50
'set osld to currenht slide
Set osld = ActiveWindow.Selection.SlideRange(1)
' Check if there are at least two shapes on the slide
If osld.Shapes.Count >= 2 Then
' Get the second shape on the slide
shapeIndex = 2 ' Change this index if the second shape is not the desired one
With osld.Shapes(shapeIndex)
' Change the dimensions of the shape
.Width = 930
.Height = 428
.Left = 15
.Top = 77
End With
End If
End Sub
|
|
| Tags |
| powe |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to change the internal wall dimensions for T room | mummy | Visio | 0 | 06-15-2017 09:23 PM |
| How to change size / shape of a shape in a stencil | tomgoodell | Visio | 1 | 06-30-2016 04:40 AM |
Dimensions of a Table Created in Word 2013 Change when saved in Word 2016
|
PKW57 | Word Tables | 2 | 05-26-2016 05:15 AM |
Word - Resize image to specified selected cells' dimensions
|
FaizanRoshan | Word VBA | 7 | 10-18-2015 03:34 PM |
| Determine if a shape is selected | Byron Polk | Word VBA | 2 | 08-06-2014 02:26 AM |