2012-08-25 38 views
4

我创建了一个标签在Word文档中这样如何使用c#将Word文档中的图形边框设置为无?

public void CreateLabel(string LabelName, int left, int top, int width, int height, string text) 
    { 
     var oRange = currentDoc.Bookmarks.get_Item("\\endofdoc").Range; 
     var oshape = oRange.Document.Shapes.AddLabel(MsoTextOrientation.msoTextOrientationHorizontal, left, top, width, height); 

     oshape.Name = LabelName; 
     oshape.TextFrame.ContainingRange.Borders.OutsideLineStyle=WdLineStyle.wdLineStyleNone; 
     oshape.TextFrame.ContainingRange.Text = text; 
     oshape.TextFrame.ContainingRange.Font.Size = 14; 
    } 

但它从来没有设置边框none.what问题?

回答

2

关于格式化Shape的行,有一个很好的article。你可以找到一些关于line formathing的东西,这是我的问题的解决方案。它对其他人很有用。

oshape.Line.Visible = MsoTriState.msoFalse; 
相关问题