Bonjour
j'ai réalisé une macro VBA sous word2013 qui me permet de faire:
mise en forme de paragraphe: interligne 0, espacements, alignement du texte...
mise en forme de l'objet: marges de 0com intérieur haut, gauche, bas, droit
la macro fonctionne à merveille lorsque je dessine une forme que j'écrive du texte à l'intérieure
mais dès que la forme est à l'intéreur d'une zone de dessin, elle ne marche plus
ci-joint le code que j'ai réalisé.
Merci d'avance
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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 Sub LibeleFigures() 'Aligner le texte des les libélés des figures ' Marges des Zones de texte Sélectionnées ' paragraphes: aligments + espacements 'Ci-dessous' code pour ajouter de la couleur 'Selection.ShapeRange.Fill.ForeColor.RGB = RGB(255, 255, 255) 'Arrière plan supprimé Selection.ShapeRange.Fill.Visible = msoFalse 'paramètres du texte dans la forme Selection.ShapeRange.TextFrame.MarginBottom = 0 Selection.ShapeRange.TextFrame.MarginLeft = 0 Selection.ShapeRange.TextFrame.MarginRight = 0 Selection.ShapeRange.TextFrame.MarginTop = 0 Selection.ShapeRange.TextFrame.VerticalAnchor = msoAnchorMiddle 'Mise en forme de paragraphe With Selection.ParagraphFormat .LeftIndent = CentimetersToPoints(0) .RightIndent = CentimetersToPoints(0) .SpaceBefore = 0 .SpaceBeforeAuto = False .SpaceAfter = 0 .SpaceAfterAuto = False .LineSpacingRule = wdLineSpaceSingle .Alignment = wdAlignParagraphCenter .WidowControl = True .KeepWithNext = False .KeepTogether = False .PageBreakBefore = False .NoLineNumber = False .Hyphenation = True .FirstLineIndent = CentimetersToPoints(0) .OutlineLevel = wdOutlineLevelBodyText .CharacterUnitLeftIndent = 0 .CharacterUnitRightIndent = 0 .CharacterUnitFirstLineIndent = 0 .LineUnitBefore = 0 .LineUnitAfter = 0 .MirrorIndents = False .TextboxTightWrap = wdTightNone .CollapsedByDefault = False End With ' End Sub
Partager