我在 Word 2010 中制作了一个编号列表。每个列表条目也有一个图像。我想居中对齐所有图像,但是当我尝试居中对齐图像时,上面的文本也会居中。
如何在不居中上下文本的情况下居中对齐列表中的图像。
好的,这就是你要做的:
不幸的是,对多个图像执行此操作是有问题的。格式刷不起作用。此外,在尝试选择图像时,仅使用宏记录器会导致问题。
因此,创建一个 VBA 宏并将其绑定到一个键似乎是使这个超级高效的唯一方法。在这方面,这里有两个有用的帖子:
从这些参考资料中的第一个开始,我测试了以下 VBA 宏。似乎工作正常!
Sub FormatMyPicture()
Dim myShape As Shape
If Selection.InlineShapes.Count > 0 Then
Set myShape = Selection.InlineShapes(1).ConvertToShape
ElseIf Selection.ShapeRange.Count > 0 Then
Set myShape = Selection.ShapeRange(1)
Else
MsgBox "Please select a picture first."
Exit Sub
End If
With myShape
.WrapFormat.Type = wdWrapTopBottom
.WrapFormat.DistanceTop = InchesToPoints(0.2)
.WrapFormat.DistanceBottom = InchesToPoints(0.2)
.RelativeHorizontalPosition = wdRelativeHorizontalPositionPage
.Left = wdShapeCenter
End With
End Sub
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
6016 次 |
| 最近记录: |