Owl.Word.WordBuilder.CreateTextParagraph C# (CSharp) Method

CreateTextParagraph() public method

public CreateTextParagraph ( string styleName, string text ) : void
styleName string
text string
return void
        public void CreateTextParagraph(string styleName, string text)
        {
            var titleCreator = new ParagraphCreator();
            titleCreator.CreateTextParagraph(this._package, styleName, HorizontalAlignmentType.Left, text, null);
        }

Same methods

WordBuilder::CreateTextParagraph ( TextParagraphType paragraphType, HorizontalAlignmentType alignment, string text ) : void
WordBuilder::CreateTextParagraph ( TextParagraphType paragraphType, HorizontalAlignmentType alignment, string text, FormatStyle formatStyle ) : void
WordBuilder::CreateTextParagraph ( TextParagraphType paragraphType, string text ) : void
WordBuilder::CreateTextParagraph ( string styleName, HorizontalAlignmentType alignment, string text ) : void
WordBuilder::CreateTextParagraph ( string styleName, HorizontalAlignmentType alignment, string text, FormatStyle formatStyle ) : void
WordBuilder::CreateTextParagraph ( string styleName, string text, FormatStyle formatStyle ) : void

Usage Example

コード例 #1
0
ファイル: Program.cs プロジェクト: FerHenrique/Owl
        static void Main(string[] args)
        {
            #region [ Create parent document ]

            string documentParent = "parent.docx";

            if (File.Exists(documentParent))
                File.Delete(documentParent);

            using (WordBuilder builder = new WordBuilder()) {

                builder.CreateDocument(documentParent);

                builder.CreateTextParagraph(TextParagraphType.Title, "Owl");
                builder.CreateTextParagraph(TextParagraphType.Normal, "Owl is a custom framework to make easier the document's development using OpenXML. Enjoy it!");
                builder.CreateTextParagraph(TextParagraphType.Normal, string.Empty);
            }

            #endregion

            #region [ Create child document ]

            string documentChild = "child.docx";

            if (File.Exists(documentChild))
                File.Delete(documentChild);

            using (WordBuilder builder = new WordBuilder()) {

                builder.CreateDocument(documentChild);

                builder.CreateTextParagraph(TextParagraphType.Heading1, "Owl");
                builder.CreateTextParagraph(TextParagraphType.Normal, "Owl is a custom framework to make easier the document's development using OpenXML. Enjoy it!");
                builder.CreateTextParagraph(TextParagraphType.Normal, string.Empty);
            }

            #endregion

            using (WordBuilder builder = new WordBuilder()) {

                builder.OpenDocument(documentParent);

                builder.MergeDocument(documentChild);
            }

            ProcessStartInfo startInfo = new ProcessStartInfo(documentParent);
            Process.Start(startInfo);
        }
All Usage Examples Of Owl.Word.WordBuilder::CreateTextParagraph