Use the .top and .left and .width and .height properties to position a
shape and size it.
Here's a little snippit of code to get you started.
Option Explicit
'Developed by Brian Reilly, MVP 8-05-2007
Public lTop As Long
Public lLeft As Long
Public lWidth As Long
Public lHeight As Long
Sub GetPosition()
'Picks up the position and size of a selected shape
'and stores it as a variable
With ActiveWindow.Selection.ShapeRange
MsgBox .Top
lTop = .Top
MsgBox .Left
lLeft = .Left
MsgBox .Width
lWidth = .Width
MsgBox .Height
lHeight = .Height
End With
End Sub
Sub Place_Position()
'Uses the stored variable values to reposition and
'resize a selected shape
With ActiveWindow.Selection.ShapeRange
.Top = lTop
.Left = lLeft
.Width = lWidth
.Height = lHeight
End With
End Sub
Brian Reilly, MVP
On Tue, 31 Jul 2007 20:17:33 +0200, "Céline" <(E-Mail Removed)>
wrote:
>Hi,
>
>I'm trying to create a jigsaw puzzle with VBA PowerPoint. But I don't know
>how to drag a shape. Is there someone who can help me to this ?
>
>Thanks a lot,
>Céline
>
|