首页 > 解决方案 > 在 Word VSTO 加载项中查找文档边框和表格之间的距离

问题描述

我正在尝试查找 Word 文档的左边框和 VSTO 中表格的左边框之间的像素距离。

我已经尝试过以下方法:

int height = table.Range.Information[Word.WdInformation.wdVerticalPositionRelativeToTextBoundary];

// This isn't working - there is no get_information method in Range object
Word.Range range = table.Rows[1].Range;
int height = 
range.get_Information(Word.WdInformation.wdActiveEndAdjustedPageNumber);

有没有办法做到这一点,或者 VSTO 会阻止对相对于页面的像素进行操作?

标签: c#vsto

解决方案


推荐阅读