如何在vb.net中识别inlineshape? [英] How to identify an inlineshape in vb.net?

查看:170
本文介绍了如何在vb.net中识别inlineshape?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,

我正在尝试编写一个vb.net程序,以更新Word文件中的图表对象.图表被嵌入到Word文件中的不同位置.

我设法通过使用以下方法直接访问图表来做到这一点:

Hello,

I am trying to code a vb.net program that updates chart objects in a word file. The charts are embedded in the word file at various locations.

I managed to do it by directly accessing the chart using:

If .Item(i).Type = WdInlineShapeType.wdInlineShapeEmbeddedOLEObject Then
   Dim chartShape As Word.InlineShape = WA.Selection.Document.InlineShapes.Item(4)



问题在于文件更改后(我不记得做任何事情..),内联对象的顺序被搞砸了.. !!

是否可以在对象上附加某种描述,以便我每次都能知道访问哪个对象?

在此先谢谢您!



The problem is that after a change in the file (I don''t remember doing anything..) the order of the inline objects is screwed up..!

Is it possible the attach some kind of description on the object so that I will be able to know which one I access each time?

Thanks in advance!

推荐答案

您可以尝试在图表中添加注释.我认为这是最简单的方法.
You can try adding comments to the chart. I think that would be the easiest way to get this going.


谢谢,

我用WA.Selection.Document.InlineShapes.Item(i).AlternativeText property来完成技巧;)就是在每个想要的对象中,在 word-> emmbed obj-> format obj-> Alt txt 中设置适当的文本之后
Thank you,

I used the WA.Selection.Document.InlineShapes.Item(i).AlternativeText property to do the trick ;) That is after setting the appropriate text inside the word->emmbeded obj->format obj->Alt txt in every object I wanted to manipulate.


这篇关于如何在vb.net中识别inlineshape?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆