Compartir a través de


EditPoint2.Cut (Método)

Copia en el Portapapeles el intervalo de texto especificado y lo elimina del documento.

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

Sintaxis

'Declaración
Sub Cut ( _
    PointOrCount As Object, _
    Append As Boolean _
)
void Cut(
    Object PointOrCount,
    bool Append
)
void Cut(
    [InAttribute] Object^ PointOrCount, 
    [InAttribute] bool Append
)
abstract Cut : 
        PointOrCount:Object * 
        Append:bool -> unit
function Cut(
    PointOrCount : Object, 
    Append : boolean
)

Parámetros

  • PointOrCount
    Tipo: Object

    Obligatorio. Objeto TextPoint o número de caracteres.

  • Append
    Tipo: Boolean

    Opcional. Indica si se ha de agregar al Portapapeles el texto seleccionado. El valor predeterminado es false.

Comentarios

Si PointOrCount es un objeto TextPoint, Cut corta el texto entre el punto de edición y PointOrCount y lo coloca en el Portapapeles. Si el valor de PointOrCount es un número entero, Cut corta el texto situado detrás del punto de edición en el número de caracteres especificado a continuación de este punto (agregando un carácter por cada secuencia de nueva línea implícita al final de cada línea). Si el valor de PointOrCount es negativo, Cut corta texto situado delante del punto de edición.

Si el valor de Append es true, Cut agrega la selección al contenido actual del Portapapeles en lugar de reemplazarlo.

Ejemplos

Sub CutExample()
   Dim objTextDoc As TextDocument
   Dim objEditPt As EditPoint, iCtr As Integer
        
   ' Create a new text file.
   DTE.ItemOperations.NewFile("General\Text File")
        
   ' Get a handle to the new document and create an EditPoint.
   objTextDoc = DTE.ActiveDocument.Object("TextDocument")
   objEditPt = objTextDoc.StartPoint.CreateEditPoint
       
   ' Insert ten lines of text.
   For iCtr = 1 To 10
      objeditpt.Insert("This is a test." & Chr(13))
   Next iCtr
        
   ' Copies the fourth word of the fourth line, pastes it, 
   ' and then cuts the fourth word of the eighth line.
   objEditPt.StartOfDocument()
   objEditPt.LineDown(3)
   objEditPt.WordRight(3)
   objEditPt.Copy(4)
   objEditPt.Paste()
   objEditPt.LineDown(3)
   objEditPt.WordRight(3)
   objEditPt.Cut(4)
End Sub

Seguridad de .NET Framework

Vea también

Referencia

EditPoint2 Interfaz

EnvDTE80 (Espacio de nombres)