Compartir a través de


DocumentBase.SelectionChange (Evento)

Se produce cuando la selección cambia en la ventana de documento.

Espacio de nombres:  Microsoft.Office.Tools.Word
Ensamblado:  Microsoft.Office.Tools.Word.v4.0.Utilities (en Microsoft.Office.Tools.Word.v4.0.Utilities.dll)

Sintaxis

'Declaración
Public Event SelectionChange As SelectionEventHandler
public event SelectionEventHandler SelectionChange

Ejemplos

En el ejemplo de código siguiente se muestra un mensaje que indica que la selección ha cambiado cada vez que se cambia la selección dentro del documento.Para usar este ejemplo, ejecútelo desde la clase ThisDocument en un proyecto de nivel de documento.

Private Sub DocumentSelectionChange()
    AddHandler Me.SelectionChange, AddressOf ThisDocument_SelectionChange
End Sub

Private Sub ThisDocument_SelectionChange(ByVal sender As Object, ByVal e As Microsoft.Office. _
    Tools.Word.SelectionEventArgs)
    MessageBox.Show("The selection in the document has changed.")
End Sub
private void DocumentSelectionChange()
{
    this.SelectionChange += new Microsoft.Office.Tools.Word.SelectionEventHandler(ThisDocument_SelectionChange);
}

void ThisDocument_SelectionChange(object sender, Microsoft.Office.Tools.Word.SelectionEventArgs e)
{
    MessageBox.Show("The selection in the document has changed.");
}

Seguridad de .NET Framework

Vea también

Referencia

DocumentBase Clase

Microsoft.Office.Tools.Word (Espacio de nombres)