vbscript 添加Space for Equ

Posted

tags:

篇首语:本文由小常识网(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的主要内容,如果未能解决你的问题,请参考以下文章

安装软件出现 could not access vbscript run time for custom action 错误

vbscript的for循环里面怎么退出此次循环?

高斯消元模板

如何在 VBScript for Classic-ASP 中执行单行 If 语句?

在VBScript中将项目添加到数组

VBscript 替换文本但添加空行