Proprietà Document.Words (System 2007)

Aggiornamento: novembre 2007

Ottiene un insieme di Microsoft.Office.Interop.Word.Words che rappresenta tutte le parole del documento.

Spazio dei nomi:  Microsoft.Office.Tools.Word
Assembly:  Microsoft.Office.Tools.Word.v9.0 (in Microsoft.Office.Tools.Word.v9.0.dll)

Sintassi

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

Dim instance As Document
Dim value As Words

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

Valore proprietà

Tipo: Microsoft.Office.Interop.Word.Words

Insieme di Microsoft.Office.Interop.Word.Words che rappresenta tutte le parole del documento.

Note

I segni di paragrafo e di punteggiatura presenti in un documento sono inclusi nell'insieme di Microsoft.Office.Interop.Word.Words.

Esempi

Nell'esempio di codice riportato di seguito viene illustrato come aggiungere una riga di testo al documento e come utilizzare la proprietà Words per impostare il colore della prima parola del documento su blu.

Questo esempio è per una personalizzazione a livello di documento.

Private Sub DocumentWords()
    Dim start As Object = 0
    Dim [end] As Object = 0
    Dim range1 As Word.Range = Me.Range(start, [end])
    range1.Text = "This is the first sentence in the document."

    Me.Words.First.Font.Color = Word.WdColor.wdColorBlue
End Sub 
private void DocumentWords()
{
    object start = 0;
    object end = 0;
    Word.Range range1 = this.Range(ref start, ref end);
    range1.Text = "This is the first sentence in the document.";

    this.Words.First.Font.Color = Word.WdColor.wdColorBlue;
}

Autorizzazioni

Vedere anche

Riferimenti

Document Classe

Membri Document

Spazio dei nomi Microsoft.Office.Tools.Word