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

CreateTextParagraph() public method

public CreateTextParagraph ( TextParagraphType paragraphType, HorizontalAlignmentType alignment, string text ) : void
paragraphType TextParagraphType
alignment HorizontalAlignmentType
text string
return void
        public void CreateTextParagraph(TextParagraphType paragraphType, HorizontalAlignmentType alignment, string text)
        {
            var titleCreator = new ParagraphCreator();
            titleCreator.CreateTextParagraph(this._package, paragraphType, alignment, text);
        }

Same methods

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 ) : void
WordBuilder::CreateTextParagraph ( string styleName, string text, FormatStyle formatStyle ) : void

Usage Example

Example #1
0
        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