Compartilhar via


Método EditPoint2.Copy

Copia o intervalo especificado de texto na área de transferência.

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

Sintaxe

'Declaração
Sub Copy ( _
    PointOrCount As Object, _
    Append As Boolean _
)
void Copy(
    Object PointOrCount,
    bool Append
)
void Copy(
    [InAttribute] Object^ PointOrCount, 
    [InAttribute] bool Append
)
abstract Copy : 
        PointOrCount:Object * 
        Append:bool -> unit
function Copy(
    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 o argumento for um objeto de TextPoint , Copy copia uma cadeia de caracteres que representa o texto entre o ponto de edição e PointOrCount. Se o argumento for um inteiro, então Copy copia uma cadeia de caracteres que representa o número especificado de caracteres após o ponto edition (contagem uma para cada sequência implícita de nova linha no final de cada linha). Se PointOrCount for negativo, as cópias de Copy texto antes do ponto de edição vez de em seguida.

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

Exemplos

Sub CopyExample()
   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