1200字范文,内容丰富有趣,写作的好帮手!
1200字范文 > html to word mathml 在MS Word中将MathML转换为MathType

html to word mathml 在MS Word中将MathML转换为MathType

时间:2022-04-08 02:12:32

相关推荐

html to word mathml 在MS Word中将MathML转换为MathType

我正在从XML & MathML转换为MS Word文档。

我使用MFC和Word自动化,所以不应该这样写的文字没有问题:在MS Word中将MathML转换为MathType

_Application app;

COleVariant vtOpt(DISP_E_PARAMNOTFOUND, VT_ERROR),

vtTrue((short)TRUE),

vtFalse((short)FALSE);

app.CreateDispatch("Word.Application",NULL);

Documents docs = app.GetDocuments();

_Document doc = docs.Add (vtOpt, vtOpt, vtOpt, vtOpt);

Range range = doc.Range (vtOpt, vtOpt);

range.InsertAfter (_T("Hello Word!"));

现在的问题是转换MATHML式到嵌入式MathType的对象。我发现的一种可能的方法是在TeX中编写方程,然后以编程方式调用MTCommand_TeXToggle(在Word的MathType 6.5库中找到)宏,用MathType OLE对象替换TeX。但是,我必须以某种方式将MathML转换为TeX,但这并不容易。

我知道,MathType的OLE对象应接受原始数据MATHML,但是当我试图创建和访问OLE对象编程:

InlineShapes shapes = doc.GetInlineShapes();

InlineShape control = shapes.AddOLEObject (COleVariant("Equation.DSMT4"), vtOpt, vtFalse, vtFalse, vtOpt, vtOpt, vtOpt, vtOpt);

OLEFormat fm = control.GetOLEFormat();

COleDispatchDriver drv = fm.GetObject();

我最终没有合理的接口与喂它MathML数据。 所以,问题是: 1)有没有办法控制OLE对象并发送一些MathML数据? 或 2)有没有办法获得一个MS Word VB宏,将选择从MathML转换为MathType OLE对象?

由于提前, 尼克止住

-06-09

stanch

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。