Share via


Selection.Delete Method

Deletes the specified number of characters or words.

Namespace:  Microsoft.Office.Interop.Word
Assembly:  Microsoft.Office.Interop.Word (in Microsoft.Office.Interop.Word.dll)

Syntax

'Declaration
Function Delete ( _
    ByRef Unit As Object, _
    ByRef Count As Object _
) As Integer
'Usage
Dim instance As Selection
Dim Unit As Object
Dim Count As Object
Dim returnValue As Integer

returnValue = instance.Delete(Unit, Count)
int Delete(
    ref Object Unit,
    ref Object Count
)

Parameters

  • Unit
    Type: System.Object%
    Optional Object. The unit by which the collapsed range or selection is to be deleted. Can be one of the following WdUnits constants: wdCharacter (default) or wdWord.
  • Count
    Type: System.Object%
    Optional Object. The number of units to be deleted. To delete units after the selection, collapse the selection and use a positive number. To delete units before the selection, collapse the selection and use a negative number.

Return Value

Type: System.Int32

Remarks

This method returns an Integer value that indicates the number of items deleted, or it returns 0 (zero) if the deletion was unsuccessful.

See Also

Reference

Selection Interface

Selection Members

Microsoft.Office.Interop.Word Namespace