|
没问题,可以运行。代码如下:
Sub ImageAlignCenter()
With ActiveDocument.Content.Find
.ClearFormatting '清除格式设置
With .Replacement '替换条件
.ClearFormatting '清除格式设置
End With
.Execute FindText:="^l", ReplaceWith:="^p", Format:=True, Replace:=wdReplaceAll
End With
For Each InlineS In ActiveDocument.InlineShapes
InlineS.Select
Selection.MoveLeft Unit:=wdWord, Count:=1
Selection.TypeParagraph
Next
With ActiveDocument.Content.Find
.ClearFormatting '清除格式设置
With .Replacement '替换条件
.ClearFormatting '清除格式设置
End With
.Execute FindText:="^p^p", ReplaceWith:="^p", Format:=True, Replace:=wdReplaceAll
End With
For Each InlineS In ActiveDocument.InlineShapes
InlineS.Select
ActiveWindow.Selection.ParagraphFormat.Alignment = WdParagraphAlignment.wdAlignParagraphCenter
Next
End Sub
你在使用过程中根本就没有删除对中文说明部份增加注解符号,所以出错。
|
|