word将mathtype公式批量转为latex公式

最近,由于工作学习需要,要将word里面的mathype公式转为latex公式。
查了查资料,有alt+\的操作,这样太慢了。通过下面链接的操作,结合起来可以解决问题。

某乎:https://www.zhihu.com/question/532353646

csdn:https://blog.csdn.net/m0_52232795/article/details/130617795

某乎比较详细,但是配合csdn这个更好理解。

csdn这个经过操作之后,会发现,找不到mtEqToLatex()

因此,需要自己新建一个宏,代码如下

复制代码
Sub mtEqToLatex()
    Dim fd As Field
    Dim fw As Range
    Dim i As Long
    
    t0 = Now
    Set fw = Selection.Range
    If fw.Start = fw.End Then Exit Sub
    Application.ScreenUpdating = False
    
    For Each fd In fw.Fields
        If fd.Code Like "*EMBED Equation.*" Then
            fd.Select
            MathTypeCommands.MTCommand_TeXToggle
            i = i + 1
        End If
    Next
    
    fw.Select
    Application.ScreenUpdating = True
    Set fw = Nothing
    Set fd = Nothing
    Debug.Print DateDiff("s", t0, Now)
    MsgBox Format(i, "完成 共处理了0个公式")
End Sub
相关推荐
SiYuanFeng6 小时前
【Word 排版】文本框/文字行间距异常偏大的解决方案
word
belldeep11 小时前
python:markdown + python-docx 将 Markdown 文件格式转为 Word 文档
python·word·markdown·docx
seasonsyy11 小时前
CTex 2.8.0 更改编辑区文字大小
latex·ctex·winedit
gc_229913 小时前
学习C#调用OpenXml操作word文档的基本用法(16:学习文档脚注类)
word·openxml·脚注
Fighting_p14 小时前
【预览word文档】使用插件 docx-preview 预览线上 word 文档
开发语言·c#·word
薛定谔的猫-菜鸟程序员18 小时前
基于Node.js+Pandoc实现Markdown文件无损转换为Word文档的小工具
node.js·word·vim
森森-曦1 天前
在word中如何设置从第二页开始页码编号
word
爱学习 爱分享1 天前
word中批量替换
word
selina89212 天前
word中脚注编号如何设置不显示?
word
叫我莫言鸭2 天前
关于word生成报告的POI学习
学习·word