Export (0) Print
Expand All
Expand Minimize

PadToColumn Method (General Extensibility)

Visual Studio .NET 2003

Fills the current line in the buffer with empty characters (white space) to the given column.

[Visual Basic .NET]
Public Sub PadToColumn( _
   ByVal Column As Long _
[Visual Basic 6]
Sub PadToColumn( _
   ByVal Column As Long _
HRESULT __stdcall PadToColumn(
   long Column
void PadToColumn(
   int Column
[JScript .NET]
public function PadToColumn(
   Column : int


Required. The number of columns to pad, starting at one.


PadToColumn inserts tabs and spaces, according to global settings, from the edit point's or selection's display column to the specified display column. If the edit point or active end of the selection already lies beyond the specified column, PadToColumn does nothing. For TextSelection.PadToColumn, the selection immediately follows the inserted white space and is collapsed.


Sub PadToColumnExample()
   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
End Sub

See Also

Applies To: EditPoint Object | TextSelection Object

© 2014 Microsoft