This documentation is archived and is not being maintained.

Paste Method (General Extensibility)

Visual Studio .NET 2003

Inserts the clipboard contents at the current location.

[Visual Basic .NET]
Public Sub Paste() 
[Visual Basic 6]
Sub Paste() 
[C++]
HRESULT __stdcall Paste();
[C#]
void Paste();
[JScript .NET]
public function Paste()

Remarks

Paste moves the edit point past the insertion.

Example

Sub PasteExample()
   Dim objTextDoc As TextDocument
   Dim objEditPt As EditPoint, iCtr As Integer
        
   'Create a new text file.
   Call 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 and pastes it, 
   '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

See Also

Applies To: EditPoint Object | TextSelection Object

Show: