EditPoint2.Copy(Object, Boolean) Método

Definição

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

void Copy(winrt::Windows::Foundation::IInspectable const & PointOrCount, bool Append = false);
[System.Runtime.InteropServices.DispId(136)]
public void Copy (object PointOrCount, bool Append = false);
[<System.Runtime.InteropServices.DispId(136)>]
abstract member Copy : obj * bool -> unit
Public Sub Copy (PointOrCount As Object, Optional Append As Boolean = false)

Parâmetros

PointOrCount
Object

Obrigatórios. Um objeto TextPoint ou um número de caracteres.

Append
Boolean

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

Implementações

Atributos

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  

Comentários

Se o argumento for um TextPoint objeto, o Copy copiará uma cadeia de caracteres que representa o texto entre o ponto de edição e o PointOrCount . Se o argumento for um inteiro, o Copy copiará uma cadeia de caracteres que representa o número especificado de caractere após o ponto de edição (contando um para cada seqüência de nova linha implícita no final de cada linha). Se PointOrCount for negativo, Copy o copiará o texto antes do ponto de edição, em vez de depois.

Se Append for true , Copy anexará a seleção ao conteúdo da área de transferência atual em vez de substituí-la.

Aplica-se a