Back to Devexpress

NotesSlide.TextArea Property

officefileapi-devexpress-dot-docs-dot-presentation-dot-notesslide-6050e9d2.md

latest3.0 KB
Original Source

NotesSlide.TextArea Property

Obtains the note text box. Allows you to specify note text and format settings.

Namespace : DevExpress.Docs.Presentation

Assembly : DevExpress.Docs.Presentation.v25.2.dll

NuGet Package : DevExpress.Docs.Presentation

Declaration

csharp
public TextArea TextArea { get; }
vb
Public ReadOnly Property TextArea As TextArea

Property Value

TypeDescription
TextArea

An object that contains text settings.

|

Example

How to: Specify Note Settings

The following code snippet obtains and changes note settings:

csharp
using DevExpress.Docs;
using DevExpress.Docs.Presentation;
using System.Drawing;
//...

using (var presentation = new Presentation(File.ReadAllBytes(@"C:\Documents\Presentation.pptx"))) {
    Slide slide = presentation.Slides[0]; 

    var note = slide.Notes;
    note.TextArea.Text = "updated text";

    // Create paragraph properties
    ParagraphProperties textParagraphProperties = new ParagraphProperties() {
        TextProperties = new TextProperties() { HighlightColor = new OfficeColor(Color.Red) }
    };

    // Apply text properties to the note
    note.TextArea.ParagraphProperties = textParagraphProperties;
    note.TextArea.Level1ParagraphProperties = textParagraphProperties;

    presentation.SaveDocument(new FileStream("C://Documents//presentation_updated.pptx", FileMode.OpenOrCreate, FileAccess.ReadWrite));
}
vb
Imports DevExpress.Docs
Imports DevExpress.Docs.Presentation
Imports System.Drawing

Using presentation = New Presentation(File.ReadAllBytes("C:\Documents\Presentation.pptx"))
    Dim slide As Slide = presentation.Slides(0)

    Dim note = slide.Notes
    note.TextArea.Text = "updated text"

    ' Create paragraph properties
    Dim textParagraphProperties As ParagraphProperties = New ParagraphProperties() With {
        .TextProperties = New TextProperties() With {
                .HighlightColor = New OfficeColor(Color.Red)
            }
    }

    ' Apply text properties to the note
    note.TextArea.ParagraphProperties = textParagraphProperties
    note.TextArea.Level1ParagraphProperties = textParagraphProperties

    ' Save the updated presentation
    Using fs As New FileStream("C:\Documents\presentation_updated.pptx", FileMode.OpenOrCreate, FileAccess.ReadWrite)
        presentation.SaveDocument(fs)
    End Using
End Using

See Also

NotesSlide Class

NotesSlide Members

DevExpress.Docs.Presentation Namespace