TextSelection.DestructiveInsert, méthode

Insère du texte en remplaçant le texte existant.

Espace de noms :  EnvDTE
Assembly :  EnvDTE (dans EnvDTE.dll)

Syntaxe

'Déclaration
Sub DestructiveInsert ( _
    Text As String _
)
void DestructiveInsert(
    string Text
)
void DestructiveInsert(
    [InAttribute] String^ Text
)
abstract DestructiveInsert : 
        Text:string -> unit
function DestructiveInsert(
    Text : String
)

Paramètres

  • Text
    Type : String

    Requis. Représente le texte à insérer.

Notes

Les caractères de saut de ligne provoquent le déplacement de l'extrémité active de la sélection de texte au début de la ligne suivante. Un retrait peut également être inséré en fonction du langage utilisé dans le document texte.

Exemples

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

Sécurité .NET Framework

Voir aussi

Référence

TextSelection Interface

EnvDTE, espace de noms