Aligner le texte d'un label

Bonjour,
Il s'agit d'un code vb qui pilote un ppt.

Je cherche à ce que le label qui est créé ait son texte aligné à gauche et pas centré (horizontalement) par défaut.
Merci beaucoup pour votre aide,

With presppt
Set Sh1 = .Slides(numsli).Shapes.AddTextbox(Orientation:=msoTextOrientationHorizontal, Left:=35, Top:=235 + taille, Width:=120, Height:=100)
With Sh1.TextFrame.TextRange
.Text = ajoutref
With .Font
.Name = "Verdana"
.Size = 10
.Bold = msoCFalse
.Color.RGB = RGB(0, 0, 0)
End With
End With
End With
NbShpe = presppt.Slides(numsli).Shapes.Count

1 réponse

  • Votes
  • Date
  • Date décroissante
  1. Bonjour,

        With presppt
            Set Sh1 = .Slides(numsli).Shapes.AddTextbox(Orientation:=msoTextOrientationHorizontal, Left:=35, Top:=235 + taille, Width:=120, Height:=100)
            With Sh1.TextFrame.TextRange
                .Text = ajoutref
                .ParagraphFormat.Alignment = ppAlignCenter
                With .Font
                    .Name = "Verdana"
                    .Size = 10
                    .Bold = msoCFalse
                    .Color.RGB = RGB(0, 0, 0)
                End With
            End With
        End With
        NbShpe = presppt.Slides(numsli).Shapes.Count