如何在Word VBA中提取形状坐标
我正在尝试在 Word 中编写一个 VBA 宏,该宏将提取形状并在 Visio 中构建它们。我在获取文档中形状的 XY 坐标时遇到一些问题。我尝试使用形状对象的顶部和左侧属性。 Left 属性似乎工作正常,但 Top 似乎工作不正常。靠近页面顶部的形状可以与底部的形状具有相同的顶部,因此顶部似乎不适用于 Y 坐标,这对我来说没有意义。
有什么想法或建议吗?
I'm trying to write a VBA macro in Word that will extract shapes and build them in Visio. I'm having some trouble getting the X Y coordinates of the shape in the document. I have tried using the Top and Left properties of the shape objects. The Left property seems to work fine, but the Top doesn't seem to work properly. A shape near the top of the page can have the same top as a shape at the bottom, so the top doesn't seem to apply to the Y coordinate, which doesn't make sense to me.
Any thoughts or suggestions?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Jon,“顶部”属性应该随着形状改变位置而更新。您是否正在运行与此类似的脚本:
Jon, the "Top" property should update as the shape changes location. Are you running a script similar to this: