1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87
|
Procedure de chargement de l'image ( 20 slides sur lequel on charge des images différentes )
Public Sub getLoadImage(ByVal numImg As Integer, ByVal intImgClick As Integer, ByVal numSld As Integer)
' ===== déclaration des variables =====
Dim objSld As Slide ' va permettre de parcourir les diapositives du diaporama
Dim objShp As Shape ' va permettre de parcourir les éléments d'une diapositive
Dim strPath As String
Dim lbFichier As String
Dim blRésult As Integer
strPath = ActivePresentation.Path
Set objSld = ActivePresentation.Slides(numSld)
objSld.Select
If Len(Trim(Str(numImg))) = 1 Then
lbFichier = "0" & Trim(Str(numImg))
Else
lbFichier = Trim(Str(numImg))
End If
Set objShp = objSld.Shapes.AddPicture(FileName:=strPath & "\images\" & lbFichier & ".bmp", LinkToFile:=msoFalse, SaveWithDocument:=msoTrue, Left:=130, Top:=86, Width:=460, Height:=368)
With objShp
.Fill.Transparency = 0#
.LockAspectRatio = msoFalse
.Height = 319.38
.Width = 431#
.Left = 1.88
.Top = 221#
.IncrementTop -2#
End With
Set objSld = Nothing
Set objShp = Nothing
'Charge les formes sur l'image zonable s'il y en a
If intImgClick = 1 Then
'MsgBox "Debut - Img Cliquable"
'Evaluate ("getForm" & Trim(lbFichier) & Trim(lbQr) & "(" & numSld & ")")
'MsgBox "Fin - Img Cliquable"
end if
End sub
Exemple fonction création shape
Public Function getForm153qr1(idSld As Integer) As Integer
' ===== déclaration des variables =====
Dim objSld As Slide ' va permettre de parcourir les diapositives du diaporama
Dim objShp As Shape ' va permettre de parcourir les éléments d'une diapositive
Set objSld = ActivePresentation.Slides(idSld)
objSld.Select
'MsgBox "getForm153qr1"
Set objShp = objSld.Shapes.AddShape(msoShapeRectangle, 161.5, 270#, 113.5, 73.75)
With objShp
.Name = "zone1"
.AutoShapeType = msoShapeRectangle
End With
Set objShp = Nothing
Set objShp = objSld.Shapes.AddShape(msoShapeRectangle, 155.88, 394.75, 28.38, 39.62)
With objShp
.Name = "zone2"
.AutoShapeType = msoShapeRectangle
.IncrementRotation 7.22
End With
Set objShp = Nothing
Set objShp = objSld.Shapes.AddShape(msoShapeRectangle, 189.88, 451.5, 90.75, 73.62)
With objShp
.Name = "zone3"
.AutoShapeType = msoShapeRectangle
End With
Set objShp = Nothing
Set objSld = Nothing
getForm153qr1 = 1
End Function |
Partager