Compartilhar via


Método EditPoint2.Cut

Copia o intervalo especificado de texto na área de transferência e excluí-lo do documento.

Namespace:  EnvDTE80
Assembly:  EnvDTE80 (em EnvDTE80.dll)

Sintaxe

'Declaração
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

    Necessário. Um objeto de TextPoint ou um número de caracteres.

  • Append
    Tipo: Boolean

    Opcional. Indica se anexar o texto selecionado à área de transferência. O padrão é false.

Comentários

Se PointOrCount é um objeto de TextPoint , Cut diminuísse o texto entre o ponto de edição e PointOrCount e colocá-lo na área de transferência. Se PointOrCount é um inteiro, então Cut diminuísse o texto depois que o ponto de edição do número especificado de caracteres após o ponto edition (que adiciona um para cada sequência implícita de nova linha no final de cada linha). Se PointOrCount for negativo, então Cut diminuísse o texto antes do ponto de edição.

Se Append é true, então Cut anexa a seleção ao conteúdo atual da área de transferência em vez de substituir a.

Exemplos

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

Segurança do .NET Framework

Consulte também

Referência

EditPoint2 Interface

Namespace EnvDTE80