2012-01-31 29 views

回答

1

嘗試用兩個文本框創建一個pptx;一個文本包裝,另一個沒有。然後在Open XML SDK 2.0 Productivity Tool中加載您的pptx,反映文檔並比較兩個文本框。

我試過了,看到Shape中TextBody的BodyProperties不同。看起來你可以設置BodyProperties的Wrap屬性來控制包裝。

代碼文本框與包裝:

 BodyProperties bodyProperties1 = new BodyProperties(){ Wrap = TextWrappingValues.Square, RightToLeftColumns = false }; 
     ShapeAutoFit shapeAutoFit1 = new ShapeAutoFit(); 

     bodyProperties1.Append(shapeAutoFit1); 
     return bodyProperties1; 

代碼文本框無包裝:

 BodyProperties bodyProperties1 = new BodyProperties(){ Wrap = TextWrappingValues.None, RightToLeftColumns = false }; 
     ShapeAutoFit shapeAutoFit1 = new ShapeAutoFit(); 

     bodyProperties1.Append(shapeAutoFit1); 
     return bodyProperties1; 
相關問題