Document.Comments-Eigenschaft (2007 System)

Aktualisiert: November 2007

Ruft eine Comments-Auflistung ab, die alle Kommentare im Dokument darstellt.

Namespace:  Microsoft.Office.Tools.Word
Assembly:  Microsoft.Office.Tools.Word.v9.0 (in Microsoft.Office.Tools.Word.v9.0.dll)

Syntax

<BrowsableAttribute(False)> _
Public ReadOnly Property Comments As Comments

Dim instance As Document
Dim value As Comments

value = instance.Comments
[BrowsableAttribute(false)]
public Comments Comments { get; }

Eigenschaftenwert

Typ: Microsoft.Office.Interop.Word.Comments

Eine Comments-Auflistung, die alle Kommentare im Dokument darstellt.

Beispiele

Im folgenden Codebeispiel wird dem ersten Absatz Text hinzugefügt, und anschließend wird dem zweiten Wort im Absatz ein Kommentar hinzugefügt.

Dieses Beispiel bezieht sich auf eine Anpassung auf Dokumentebene.

Private Sub DocumentComments()
    Me.Paragraphs(1).Range.InsertParagraphAfter()
    Me.Paragraphs(1).Range.Text = "This is sample Text"
    Dim commentText As Object = "This is comment text"
    Me.Comments.Add(Me.Paragraphs(1).Range.Words(2), commentText)
End Sub
private void DocumentComments()
{
    this.Paragraphs[1].Range.InsertParagraphAfter();
    this.Paragraphs[1].Range.Text = "This is sample Text";
    object commentText = "This is comment text";
    this.Comments.Add(this.Paragraphs[1].Range.Words[2], ref commentText);
}

Berechtigungen

Siehe auch

Referenz

Document-Klasse

Document-Member

Microsoft.Office.Tools.Word-Namespace