ApiExamples.DocumentHelper.GetParagraphText C# (CSharp) Метод

GetParagraphText() статический приватный Метод

Get paragraph text of the current document
static private GetParagraphText ( Document doc, int paraIndex ) : string
doc Document /// Current document ///
paraIndex int /// Paragraph number from collection ///
Результат string
        internal static string GetParagraphText(Document doc, int paraIndex)
        {
            return doc.FirstSection.Body.Paragraphs[paraIndex].GetText();
        }

Usage Example

Пример #1
0
        public void InsertFieldBeforeRunText()
        {
            Document doc = DocumentHelper.CreateDocumentFillWithDummyText();

            //Add some text into the paragraph
            Run run = DocumentHelper.InsertNewRun(doc, " Hello World!", 1);

            InsertFieldUsingFieldCodeFieldString(doc, " AUTHOR ", "Test Field Value", run, false, 1);

            Assert.AreEqual("Hello World!\u0013 AUTHOR \u0014Test Field Value\u0015 Hello World!\r", DocumentHelper.GetParagraphText(doc, 1));
        }
All Usage Examples Of ApiExamples.DocumentHelper::GetParagraphText