How create a jigsaw ?

C

Céline

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
 
B

Brian Reilly, MVP

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top