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
相关推荐
gc_22999 小时前
学习C#调用OpenXml操作word文档的基本用法(34:学习图形类-4)
word·openxml·anchor·浮动式布局
yuhulkjv3359 小时前
腾讯元宝公式粘贴word乱码
人工智能·chatgpt·word·deepseek·ai导出鸭
hef2881 天前
Java读取Word图片坐标的两种方法
java·开发语言·word
OEC小胖胖1 天前
ChatGPT导出Word怎么做?Chat2File 安装与使用教程
chatgpt·word·效率工具·ai工具·浏览器扩展
庖丁AI1 天前
合同比对工具怎么选?Word、PDF 和扫描件差异对比思路
pdf·word
你挚爱的强哥1 天前
【样式问题】将当前word所有文字样式、字体、字号大小 全局设置为以后任何一个新的空白文档都共享使用
word
luoyayun3611 天前
基于 DOCX 模板书签替换的 Word 文档生成方案,解决跨平台Word输出问题
word·qt word·linux word
包子源1 天前
PDF 转 Word/Excel 全链路实战:Next.js + 阿里云文档智能
pdf·word·excel
tedcloud1232 天前
academic-research-skills部署教程:构建AI辅助科研环境
服务器·人工智能·word·excel·dreamweaver
AI一天,人间一年2 天前
word删除指定页面
word