篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了vbscript 添加Space for Equ相关的知识,希望对你有一定的参考价值。
Sub addSpaceForEquation()
'word equation
Dim a As OMath
For Each a In ActiveDocument.OMaths
a.Range.Select
If Selection.Range.Previous <> ChrW(13) Then
If Selection.Range.Previous <> " " Then
Selection.Collapse wdCollapseStart
Selection.TypeText " "
End If
a.Range.Select
If Selection.Range.Next <> " " Then
Selection.Collapse wdCollapseEnd
Selection.TypeText " "
End If
End If
Next
'mathtype
Dim b As Field
For Each b In ActiveDocument.Range.Fields
If b.Type = 58 Then
b.Select
If Selection.Range.Previous <> ChrW(13) Then
If Selection.Range.Previous <> " " Then
Selection.Collapse wdCollapseStart
Selection.TypeText " "
End If
b.Select
If Selection.Range.Next <> " " Then
Selection.Collapse wdCollapseEnd
Selection.TypeText " "
End If
End If
End If
Next
End Sub
以上是关于vbscript 添加Space for Equ的主要内容,如果未能解决你的问题,请参考以下文章