Bonjour, je développe un Addin pour PowerPoint afin que les utilisateurs puisse séléctionner les styles que j'aurai au préalable défini dans mes fonctions. Pour l'exemple, si l'utilisateur sélectionne le style "title 1" alors le formattage du texte sélectionné se fera comme suit:
selection.Font.Name = FONTNAMES[1];
selection.Font.Size = 16f;
selection.Font.Bold = Office.MsoTriState.msoTrue;
selection.Font.Color.RGB = 0;
selection.ParagraphFormat.Alignment = Interop.PowerPoint.PpParagraphAlignment.ppAlignLeft;
selection.ParagraphFormat.BaseLineAlignment = Interop.PowerPoint.PpBaselineAlignment.ppBaselineAlignAuto;
selection.ParagraphFormat.LineRuleAfter = Office.MsoTriState.msoTrue;
selection.ParagraphFormat.LineRuleBefore = Office.MsoTriState.msoFalse;
selection.ParagraphFormat.LineRuleWithin = Office.MsoTriState.msoFalse;
selection.ParagraphFormat.SpaceBefore = 24f;
selection.ParagraphFormat.SpaceAfter = 0.0f;
selection.ParagraphFormat.SpaceWithin = 21f;
selection.ParagraphFormat.WordWrap = Office.MsoTriState.msoFalse;
selection.ParagraphFormat.TextDirection = Interop.PowerPoint.PpDirection.ppDirectionLeftToRight;
selection.ParagraphFormat.Bullet.StartValue = 1;
selection.ParagraphFormat.Bullet.Style = Interop.PowerPoint.PpNumberedBulletStyle.ppBulletAlphaLCPeriod;
selection.ParagraphFormat.Bullet.Type = Interop.PowerPoint.PpBulletType.ppBulletNumbered;
selection.ParagraphFormat.Bullet.UseTextColor = Office.MsoTriState.msoTrue;
selection.ParagraphFormat.Bullet.UseTextFont = Office.MsoTriState.msoTrue;
selection.ParagraphFormat.Bullet.Visible = Office.MsoTriState.msoTrue;Vous remarquerez que j'utilise l'objet BulletFormat. Cela fonctionne parfaitement pour le titre de niveau 1. Cependant j'aimerai que lorsque l'utilisateur sélectionne le style "title 2", la hierarchie entre les deux titres se fasse automatiquement. Actuellement, voici le résultat que j'obtiens:
1. Titre 12. Titre 2Comment est-ce possible de spécifier le niveau de l'objet Bullet afin d'obtenir le résultat suivant:
1. Titre 11.2. Titre 2Merci d'avance pour votre aide et vos suggestions...