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 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254
| Private Sub Commande66_Click()
Dim ppt As PowerPoint.Application
Dim presentation As PowerPoint.presentation
Dim slide As PowerPoint.slide
Dim shape1 As PowerPoint.shape, shape2 As PowerPoint.shape, shape3 As PowerPoint.shape
Dim shape4 As PowerPoint.shape, shape5 As PowerPoint.shape, shape6 As PowerPoint.shape
Dim shape7 As PowerPoint.shape, shape8 As PowerPoint.shape, shape9 As PowerPoint.shape
Dim shape10 As PowerPoint.shape, shape11 As PowerPoint.shape, shape12 As PowerPoint.shape
Dim vc1 As String, vc2 As String, vc3 As String, vc4 As String, vc5 As String, vc6 As String
Dim vc7 As String, vc8 As String, vc9 As String, vc10 As String, vc11 As String, vc12 As String
' Prendre les valeurs des champs courants dans le formulaire
vc1 = "Date : " & Format(Me.date_evt.Value, "dddd d mmmm yyyy")
vc2 = "Nombre de convives : " & "Base " & Me.nbr_pax.Value & " personnes"
vc3 = "Déroulé de la prestation : " & Me.typ_prest.Value
vc4 = "Lieu : " & Me.lieu.Value
If Me.ref_pres.Value <> "" Then
vc5 = "Réf : " & Me.ref_pres.Value
Else
vc5 = ""
End If
'vc5 = "Réf : " & Me.ref_pres.Value
vc6 = Me.nom_clt.Value & " - " & Me.cod_clt.Value
vc7 = Me.prnom_ctact.Value & " " & Me.nom_ctact.Value
vc8 = "Tél : " & Me.mobile.Value
vc9 = "E-mail : " & Me.mail
vc10 = Me.nom_cial.Value
vc11 = "Tél : " & Me.tel.Value
vc12 = "E-mail : " & Me.mail_cial.Value
' Ouvrir PowerPoint
Set ppt = New PowerPoint.Application
ppt.Visible = True
' Ouvrir la présentation
Set presentation = ppt.Presentations.Open("\\10.4.95.13\Commun\MALEK\Dev_Access\GDD\test2.pptx")
' Accéder à la diapositive 2
Set slide = presentation.Slides(2)
' Créer une nouvelle zone de texte pour chaque champ et y insérer la valeur du champ
Set shape1 = slide.Shapes.AddTextbox(msoTextOrientationHorizontal, Left:=341.334, Top:=126.44, Width:=255.118, Height:=19.845)
shape1.TextFrame.TextRange.Text = vc1
' Appliquer les attributs de police spécifiés
With shape1.TextFrame.TextRange.Font
.Size = 10
.Name = "Century Gothic"
.Color.RGB = RGB(0, 0, 0) ' Rouge: 0, Vert: 0, Bleu: 0
End With
' Appliquer le formatage en gras uniquement au texte "le nom de la personne :"
shape1.TextFrame.TextRange.Paragraphs(1).Characters(1, 7).Font.Bold = msoTrue ' Assurez-vous d'ajuster les positions des caractères en fonction de votre texte
' Centrer le texte
shape1.TextFrame2.TextRange.ParagraphFormat.Alignment = ppAlignCenter
'shape 2
Set shape2 = slide.Shapes.AddTextbox(msoTextOrientationHorizontal, Left:=341.334, Top:=144.302, Width:=255.118, Height:=19.845)
shape2.TextFrame.TextRange.Text = vc2
With shape2.TextFrame.TextRange.Font
.Size = 10
.Name = "Century Gothic"
.Color.RGB = RGB(0, 0, 0)
End With
shape2.TextFrame.TextRange.Paragraphs(1).Characters(1, 21).Font.Bold = msoTrue
shape2.TextFrame2.TextRange.ParagraphFormat.Alignment = ppAlignCenter
'shape 3
Set shape3 = slide.Shapes.AddTextbox(msoTextOrientationHorizontal, Left:=341.334, Top:=162.446, Width:=255.118, Height:=19.845)
shape3.TextFrame.TextRange.Text = vc3
With shape3.TextFrame.TextRange.Font
.Size = 10
.Name = "Century Gothic"
.Color.RGB = RGB(0, 0, 0)
End With
shape3.TextFrame.TextRange.Paragraphs(1).Characters(1, 27).Font.Bold = msoTrue
shape3.TextFrame2.TextRange.ParagraphFormat.Alignment = ppAlignCenter
'shape 4
Set shape4 = slide.Shapes.AddTextbox(msoTextOrientationHorizontal, Left:=341.334, Top:=180.59, Width:=255.118, Height:=19.845)
shape4.TextFrame.TextRange.Text = vc4
With shape4.TextFrame.TextRange.Font
.Size = 10
.Name = "Century Gothic"
.Color.RGB = RGB(0, 0, 0)
End With
shape4.TextFrame.TextRange.Paragraphs(1).Characters(1, 7).Font.Bold = msoTrue
shape4.TextFrame2.TextRange.ParagraphFormat.Alignment = ppAlignCenter
'shape 5
If vc5 <> "" Then
Set shape5 = slide.Shapes.AddTextbox(msoTextOrientationHorizontal, Left:=341.334, Top:=204.971, Width:=255.118, Height:=19.845)
shape5.TextFrame.TextRange.Text = vc5
With shape5.TextFrame.TextRange.Font
.Size = 10
.Name = "Century Gothic"
.Color.RGB = RGB(255, 0, 0)
.Bold = msoTrue
End With
'shape5.TextFrame.TextRange.Paragraphs(1).Characters(1, 6).Font.Bold = msoTrue
shape5.TextFrame2.TextRange.ParagraphFormat.Alignment = ppAlignCenter
End If
'shape 6
Set shape6 = slide.Shapes.AddTextbox(msoTextOrientationHorizontal, Left:=341.334, Top:=254.583, Width:=255.118, Height:=19.845)
shape6.TextFrame.TextRange.Text = vc6
With shape6.TextFrame.TextRange.Font
.Size = 10
.Name = "Century Gothic"
.Color.RGB = RGB(0, 0, 0)
.Bold = msoTrue
End With
'shape5.TextFrame.TextRange.Paragraphs(1).Characters(1, 6).Font.Bold = msoTrue
shape6.TextFrame2.TextRange.ParagraphFormat.Alignment = ppAlignCenter
'shape 7
Set shape7 = slide.Shapes.AddTextbox(msoTextOrientationHorizontal, Left:=341.334, Top:=278.964, Width:=255.118, Height:=19.845)
shape7.TextFrame.TextRange.Text = vc7
With shape7.TextFrame.TextRange.Font
.Size = 10
.Name = "Century Gothic"
.Color.RGB = RGB(0, 0, 0)
End With
'shape7.TextFrame.TextRange.Paragraphs(1).Characters(1, 7).Font.Bold = msoTrue
shape7.TextFrame2.TextRange.ParagraphFormat.Alignment = ppAlignCenter
'shape 8
Set shape8 = slide.Shapes.AddTextbox(msoTextOrientationHorizontal, Left:=341.334, Top:=298.809, Width:=255.118, Height:=19.845)
shape8.TextFrame.TextRange.Text = vc8
With shape8.TextFrame.TextRange.Font
.Size = 10
.Name = "Century Gothic"
.Color.RGB = RGB(0, 0, 0)
End With
shape8.TextFrame.TextRange.Paragraphs(1).Characters(1, 6).Font.Bold = msoTrue
shape8.TextFrame2.TextRange.ParagraphFormat.Alignment = ppAlignCenter
'shape 9
Set shape9 = slide.Shapes.AddTextbox(msoTextOrientationHorizontal, Left:=341.334, Top:=319.788, Width:=255.118, Height:=19.845)
shape9.TextFrame.TextRange.Text = vc9
With shape9.TextFrame.TextRange.Font
.Size = 10
.Name = "Century Gothic"
.Color.RGB = RGB(0, 0, 0)
End With
shape9.TextFrame.TextRange.Paragraphs(1).Characters(1, 9).Font.Bold = msoTrue
shape9.TextFrame2.TextRange.ParagraphFormat.Alignment = ppAlignCenter
'shape 10
Set shape10 = slide.Shapes.AddTextbox(msoTextOrientationHorizontal, Left:=341.334, Top:=400.869, Width:=255.118, Height:=19.845)
shape10.TextFrame.TextRange.Text = vc10
With shape10.TextFrame.TextRange.Font
.Size = 10
.Name = "Century Gothic"
.Color.RGB = RGB(0, 0, 0)
End With
'shape10.TextFrame.TextRange.Paragraphs(1).Characters(1, 9).Font.Bold = msoTrue
shape10.TextFrame2.TextRange.ParagraphFormat.Alignment = ppAlignCenter
'shape 11
Set shape11 = slide.Shapes.AddTextbox(msoTextOrientationHorizontal, Left:=341.334, Top:=432.054, Width:=255.118, Height:=19.845)
shape11.TextFrame.TextRange.Text = vc11
With shape11.TextFrame.TextRange.Font
.Size = 10
.Name = "Century Gothic"
.Color.RGB = RGB(0, 0, 0)
End With
shape11.TextFrame.TextRange.Paragraphs(1).Characters(1, 6).Font.Bold = msoTrue
shape11.TextFrame2.TextRange.ParagraphFormat.Alignment = ppAlignCenter
'shape 12
Set shape12 = slide.Shapes.AddTextbox(msoTextOrientationHorizontal, Left:=341.334, Top:=451.332, Width:=255.118, Height:=19.845)
shape12.TextFrame.TextRange.Text = vc12
With shape12.TextFrame.TextRange.Font
.Size = 10
.Name = "Century Gothic"
.Color.RGB = RGB(0, 0, 0)
End With
shape12.TextFrame.TextRange.Paragraphs(1).Characters(1, 9).Font.Bold = msoTrue
shape12.TextFrame2.TextRange.ParagraphFormat.Alignment = ppAlignCenter
End Sub |
Partager