如何使用C#和COM处理已打开的Word文档 [英] How to work with an already open word document using C# and COM

查看:128
本文介绍了如何使用C#和COM处理已打开的Word文档的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我正在使用CodedUI测试在我正在测试的Word插件上进行一些播放。我需要在文档中的对象中添加asertions。我知道如何使用COM和C#执行此操作的基础知识,但我如何使用已在桌面上打开的word文档。
所以我知道如何使用COM和C#打开文档,但播放打开word文档,所以当我添加手动编码测试时,我需要访问打开的文档...我该怎么做? div class ="h2_lin">解决方案

MS Word还不是CodedUI Test支持的技术之一。它没有必要的MSAA(accessibilty支持),CodedUI Test用于识别控件。  查看此处的链接以获取更多信息:

http:/ /blogs.msdn.com/b/gautamg/archive/2010/01/07/platform-support-for-coded-ui-test-and-fast-forward-feature-of-test-runner.aspx


该链接还提到了encodeUI测试可扩展性(以及示例Excel扩展),您可能希望检查并实现类似于您的Word插件的类似内容。


So I'm using a CodedUI test to do some playback on a Word addon I'm testing. I need to add asertions to objects in the document. I know the basics of how to do this with COM and C# but how can I work with a word document thats already opened on the desktop. So I know how to open a document using COM and C# but the playback opens the word document so when I'm adding the manual coded test I need to access that opened document...how can I do this?

解决方案

MS Word is not yet one of the supported technologies for CodedUI Test. It does not have the necessary MSAA (accessibilty support) which CodedUI Test uses for identifying controls.  Check the link here for more info: http://blogs.msdn.com/b/gautamg/archive/2010/01/07/platform-support-for-coded-ui-test-and-fast-forward-feature-of-test-runner.aspx

The link also mentions about codedUI test extensibility (and a sample Excel extension) which you may want to check out and implement something similar for your Word Addons.


这篇关于如何使用C#和COM处理已打开的Word文档的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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