【发布时间】:2020-06-29 15:21:33
【问题描述】:
我在 Microsoft Word 文档中有一些图表对象,我想使用 VBA 代码将其对齐到中心。所写的缺点似乎可以正常工作,因为它可以正确检测图形图表,但是我不知道如何将其居中。
Sub CenterChart()
Dim n As Integer, i As Integer
Dim graf As Object
n = Application.ActiveDocument.InlineShapes.Count
If n <> 0 Then
For i = 1 To n
Set graf = Application.ActiveDocument.InlineShapes(i)
If graf.HasChart Then
'Here the code to align to center
Else
End If
Next i
End If
End Sub
【问题讨论】: