检索word文档

时间:2015-07-10 11:02:26

标签: ms-word vsto word-contentcontrol

是否可以在VSTO中获取放置内容控件的位置(即页码或章节/章节)? 例如。我想检索ctrl Req234是关于chap的。 4.1(标题)或第xy页

4. Title Lorem ipsum
 4.1 Subtitle 
 Lorem ipsum 
 [Req234]
5. Title

如果更容易检索书签位置,则控件可以被书签包围。

1 个答案:

答案 0 :(得分:1)

发现Range有这种方法来实现我的任务

contentcontrol.Range.get_Information(WdInformation.wdActiveEndPageNumber);

https://msdn.microsoft.com/en-us/library/bb213848(v=office.12).aspx