Word文档中的大小

Word文档中的大小

问题描述:

当我打开ms-word文档时,此代码无法显示确切的磅数.

This code does not show me the exact size in points when i open a ms-word document.

Shape shpCanvas = oDoc.Shapes.AddCanvas(0, 0, 300, 300, ref oMissing);


正如我上面的代码,我为高度和宽度定义了300个点.但是,当我打开文档时,它将显示300磅的精确度.


As i the above code i define 300 points for height as well as for width. but when i open a document it will show me that exact 300 point it will show me more than that.

shpCanvas变量中返回了新添加的形状.为了满足您的需求,即最低300点,您可以编写以下代码:

Newly added shape is returned in shpCanvas variable. To satisfy your need i.e minimum 300 point, you can write the below code:

Shape shpCanvas = oDoc.Shapes.AddCanvas(0, 0, 300, 300, ref oMissing);
shpCanvas.MinWidth = xxx;
shpCanvas.MinHeight = xxx;