ApiExamples.ExHeaderFooter.ReplaceText C# (CSharp) Метод

ReplaceText() приватный Метод

private ReplaceText ( ) : void
Результат void
        public void ReplaceText()
        {
            //ExStart
            //ExFor:Document.FirstSection
            //ExFor:Section.HeadersFooters
            //ExFor:HeaderFooterCollection.Item(HeaderFooterType)
            //ExFor:HeaderFooter
            //ExFor:Range.Replace(String, String, Boolean, Boolean)
            //ExSummary:Shows how to replace text in the document footer.
            // Open the template document, containing obsolete copyright information in the footer.
            Document doc = new Document(MyDir + "HeaderFooter.ReplaceText.doc");

            HeaderFooterCollection headersFooters = doc.FirstSection.HeadersFooters;
            HeaderFooter footer = headersFooters[HeaderFooterType.FooterPrimary];
            footer.Range.Replace("(C) 2006 Aspose Pty Ltd.", "Copyright (C) 2011 by Aspose Pty Ltd.", false, false);

            doc.Save(MyDir + @"\Artifacts\HeaderFooter.ReplaceText.doc");
            //ExEnd

            // Verify that the appropriate changes were made to the output document.
            doc = new Document(MyDir + @"\Artifacts\HeaderFooter.ReplaceText.doc");
            Assert.IsTrue(doc.Range.Text.Contains("Copyright (C) 2011 by Aspose Pty Ltd."));
        }