Share via


TextSelection.DestructiveInsert (Método)

Inserta texto que reemplaza el texto existente.

Espacio de nombres:  EnvDTE
Ensamblado:  EnvDTE (en EnvDTE.dll)

Sintaxis

'Declaración
Sub DestructiveInsert ( _
    Text As String _
)
void DestructiveInsert(
    string Text
)
void DestructiveInsert(
    [InAttribute] String^ Text
)
abstract DestructiveInsert : 
        Text:string -> unit
function DestructiveInsert(
    Text : String
)

Parámetros

  • Text
    Tipo: String

    Obligatorio. Representa el texto que se va a insertar.

Comentarios

Los caracteres de nueva línea hacen que el extremo activo de la selección de texto se desplace al principio de la línea siguiente. También puede insertar sangría dependiendo del lenguaje utilizado en el documento de texto.

Ejemplos

Public objSel As TextSelection = DTE.ActiveDocument.Selection

Sub DestructiveInsertExample()
   ' Before running this example, open a text document.
   ' Perform operations on the text.
   objSel.StartOfDocument(False)
   Position(vsStartOfLineOptions.vsStartOfLineOptionsFirstColumn, 4)
   objSel.Copy()
   Position(vsStartOfLineOptions.vsStartOfLineOptionsFirstText, 4)
   objSel.Cut()
   Position(vsStartOfLineOptions.vsStartOfLineOptionsFirstText, 4)
   objSel.Delete()
   Position(vsStartOfLineOptions.vsStartOfLineOptionsFirstText, 4)
   objSel.DeleteLeft(6)
   objSel.DestructiveInsert("NEW TEXT")
End Sub

Sub Position(ByVal pos As vsStartOfLineOptions, ByVal ipos As Integer)
   ' Moves the insertion point down to the beginning of the next line, 
   ' and then highlights the right-most four characters.
   objSel.LineDown()
   objSel.StartOfLine(vsStartOfLineOptions.vsStartOfLineOptionsFirstText)
   objSel.CharRight(True, 4)
End Sub

Seguridad de .NET Framework

Vea también

Referencia

TextSelection Interfaz

EnvDTE (Espacio de nombres)