示例#1
0
        public XTextFrame AddTextFrame(int height, int width)
        {
            var textFrame = this.xMcFactory.createInstanceWithContext(OO.Services.TEXT_FRAME, xContext);

            if (textFrame != null)
            {
                if (textFrame is XTextFrame)
                {
                    Size size = OoUtils.MakeSize(width, height);
                    OoUtils.SetProperty(textFrame, "Size", size);
                    OoUtils.SetProperty(textFrame, "AnchorType", TextContentAnchorType.AS_CHARACTER);
                    OoUtils.SetProperty(textFrame, "LeftMargin", 0);
                    //util.Debug.GetAllProperties(textFrame);
                    XTextRange xTextRange = Text.getEnd();
                    NewParagraph();
                    Text.insertTextContent(xTextRange, textFrame as XTextFrame, false);
                    NewParagraph();
                }
            }
            return(textFrame as XTextFrame);
        }