【问题标题】:How to check the paragraph start of equation?如何检查方程的段落开头?
【发布时间】:2020-07-03 07:10:49
【问题描述】:

有一段很像

a =a_1 (x ̃_B [n]+x ̃_W [n] ) ------方程01

我怎么知道它是通过 word vba 开始的方程?

光标停在方程上时有方程形状。

但是当我使用 Range 类时,我无法获取 shpae。

【问题讨论】:

  • 这样我们就可以尝试重现您所遇到的情况,请您描述一下如何插入方程式 - 以确保我们正确地进行操作。还请告诉我们您正在使用的 Word 版本。

标签: vba ms-word


【解决方案1】:

1.找到段落中的第一个OMath对象。

2.与段落的起始位置比较。

Dim OMathStart as Long
OMathStart = -1
if ThisDocument.Paragraphs(100).Range.OMaths.Count > 0 then
    OMathStart = ThisDocument.Paragraphs(100).Range.OMaths(1).Range.Start
end if
If OMathStart > 0 and OMathStart = ThisDocument.Paragraphs(100).Range.Start then
    'Mean the Paragraph's Start position is same as OMathStart
end if

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-05-09
    • 1970-01-01
    • 2021-02-01
    • 2018-10-08
    • 2011-06-19
    • 2022-08-16
    相关资源
    最近更新 更多