timxx / pywpsrpc

Python bindings for WPS Office RPC (for Linux)
MIT License
219 stars 44 forks source link

word中公式对象OMath的方法异常 #82

Closed mjTree closed 1 year ago

mjTree commented 1 year ago

Describe the bug word文档中,随便插入一个公式,通过range对象的OMaths[1]获取公式对象,对象的ConvertToMathText等方法返回值不是字符串而是数字0。 https://learn.microsoft.com/zh-cn/office/vba/api/word.omath.converttomathtext

Screenshots image

Environment

akkuman commented 1 year ago

wps方法有点不同,你可以查看https://open.wps.cn/docs/client/wpsLoad 看看接口文档,一般获取 Document 中某个属性后,不能直接像com+msoffice那样直接 [1],大多数情况都是 ret, x = doc.xxx; x.Item(1)

mjTree commented 1 year ago

wps方法有点不同,你可以查看https://open.wps.cn/docs/client/wpsLoad 看看接口文档,一般获取 Document 中某个属性后,不能直接像com+msoffice那样直接 [1],大多数情况都是 ret, x = doc.xxx; x.Item(1)

谢谢回答,但是itme是js的写法,py的可以需要。作者以前也是说过,接口文档优先微软更齐全。

akkuman commented 1 year ago

因为这个库是直接用wps的c++接口生成的,所以是需要看c++的那份接口文档

timxx commented 1 year ago

公式相关的接口,Windows版本WPS都还没实现~ 另外,如果你想跟VB接口一样调用,可以用RpcProxy包装一下