Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

无法改变写入图片的宽高, InlineShape.Width = width提示 对象无效属性: 'tuple' object has no attribute 'Width' #93

Closed
Teccivil opened this issue Jul 22, 2024 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@Teccivil
Copy link

前面连接代码省略,以下是我在指定段落添加图片的代码(parag是我获取的指定段落的Range):

img = parag.InlineShapes.AddPicture(img_path)
img.Width = width
img.Height = height

@Teccivil Teccivil added the bug Something isn't working label Jul 22, 2024
@timxx
Copy link
Owner

timxx commented Jul 24, 2024

默认返回的是tuple,第一个是HRESULT

@timxx
Copy link
Owner

timxx commented Jul 24, 2024

可以包装一下去掉这个,参考https://github.com/timxx/pywpsrpc/wiki/RpcProxy

@Teccivil
Copy link
Author

可以包装一下去掉这个,参考https://github.com/timxx/pywpsrpc/wiki/RpcProxy

谢谢大佬,通过这个方式解决了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants