Bonjour
J'ai besoin de trouver toutes les images contenue dans un fichier word, de le redimensionner et de modifier leur alignement.
J'ai créé le bout de code suivant qui me permet de les redimensionner mais je ne trouve pas les commandes pour modifier leur placement.
J'ai essayé d'enregistrer une macro mais les menus correspondants sont grisés et inactifs.
Comment faire?
Merci de votre aide
Bernard
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 RedimmensionnerBlasons() 'Recherche des images (graphismes) Selection.Find.ClearFormatting With Selection.Find .Text = "^g" .Wrap = wdFindStop End With Dim a As Integer a = 0 While (a <> 1) Selection.Find.Execute If Not (Selection.Find.Found) Then a = 1 Else With Selection.InlineShapes(1) .Height = 50 .Width = 50 Selection.ShapeRange.Left = 495.75 Selection.ShapeRange.Top = 360.85 Selection.ShapeRange.RelativeHorizontalPosition = _ wdRelativeHorizontalPositionRightMarginArea Selection.ShapeRange.RelativeVerticalPosition = _ wdRelativeVerticalPositionLine Selection.ShapeRange.RelativeHorizontalSize = wdRelativeHorizontalSizePage Selection.ShapeRange.RelativeVerticalSize = wdRelativeVerticalSizePage Selection.ShapeRange.Left = CentimetersToPoints(-1.5) Selection.ShapeRange.LeftRelative = wdShapePositionRelativeNone Selection.ShapeRange.Top = CentimetersToPoints(1.5) Selection.ShapeRange.TopRelative = wdShapePositionRelativeNone Selection.ShapeRange.WidthRelative = wdShapeSizeRelativeNone Selection.ShapeRange.HeightRelative = wdShapeSizeRelativeNone 'Selection.ShapeRange.LockAnchor = False 'Selection.ShapeRange.LayoutInCell = True 'Selection.ShapeRange.WrapFormat.AllowOverlap = True 'Selection.ShapeRange.WrapFormat.Side = wdWrapBoth 'Selection.ShapeRange.WrapFormat.DistanceTop = CentimetersToPoints(0) 'Selection.ShapeRange.WrapFormat.DistanceBottom = CentimetersToPoints(0) 'Selection.ShapeRange.WrapFormat.DistanceLeft = CentimetersToPoints(0.32) 'Selection.ShapeRange.WrapFormat.DistanceRight = CentimetersToPoints(0.32) 'Selection.ShapeRange.WrapFormat.Type = wdWrapSquare End With End If Wend End Sub
Partager