Reputation: 43
I have a macro in Word that selects a bunch of text boxes and reduces them to 1% of their original size, so as to effectively hide them. Then another macro expands them to 100x their size, so as to re-show them.
The 2 codes are:
Sub ShrinkBox()
ActiveDocument.Shapes.Range(Array("Rectangle à coins arrondis 5", "Rectangle à coins arrondis 6")).Select
Selection.ShapeRange.ScaleHeight 0.01, msoFalse
End Sub
Sub ExpandBox()
ActiveDocument.Shapes.Range(Array("Rectangle à coins arrondis 5", "Rectangle à coins arrondis 6")).Select
Selection.ShapeRange.ScaleHeight 100, msoFalse
End Sub
This should logically bring them back exactly as they began. However, shrinking them and then expanding them again leaves them in different positions than they began. Shrinking them also fails to hide the text inside them, which through some sort of bug is displaying anyway.
I have included images of the original state, the shrunk state, and the re-expanded state.
Final: Any ideas how to fix this?
Thank you!
Upvotes: 0
Views: 45
Reputation: 2278
try this
Sub ShrinkBox()
ActiveDocument.Shapes.Range(Array("Rectangle à coins arrondis 5", "Rectangle à coins arrondis 6")).Visible = False
End Sub
Sub ExpandBox()
ActiveDocument.Shapes.Range(Array("Rectangle à coins arrondis 5", "Rectangle à coins arrondis 6")).Visible = True
End Sub
Upvotes: 1