Word 返回的单词列表无效
在 Word 插件中,我用来
this.Application.ActiveDocument.Words;
获取当前文档中所有单词的列表。现在,当我解析这个列表时,我发现 、
、.
和 \r
也在这个列表中。为什么 Word 会考虑这些词?我还查看了状态栏中的字数,这也是错误的,对于我的文档中的 7 个字,状态栏显示 9 个字。
In an Word addin, I'm using
this.Application.ActiveDocument.Words;
to get a list of all the words in the curret document. Now when I parse this list, I found the ,
, .
and \r
are also in this list. Why is Word considering these words? I also looked at the word count in the status bar and that was wrong too, as for 7 words in my document the status bar shows 9 words.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看来还是有特色啊
从:
此处
注意标点符号和段落标记文档中包含在 Words 集合中。
还发现:
here
对我说,您可以通过测试小于 A 或大于 z 的“单词”来从集合中排除标点符号。
Looks like it's a feature.
from:
here
Note Punctuation and paragraph marks in a document are included in the Words collection.
also found:
here
which says to me you can exclude punctuation from your set by testing for 'words' less than A or greater than z.