I had missed that usage of the Editpoint.Delete function. Thanks!
"Carlos J. Quintero [.NET MVP]" <carlosq@NOSPAMsogecable.com> wrote in
> In this case the optional argument is integer, so you pass the value 1
> which is the default.
>
> If you want to delete the text between 2 edit points without selecting the
> text, you use EditPoint1.Delete(EditPoint2).
>
> --
>
> Carlos J. Quintero
>
> MZ-Tools 4.0: Productivity add-ins for Visual Studio .NET
> You can code, design and document much faster.
>
http://www.mztools.com >
>
> "Emil Astrom" <emil_astrom(at)hotmail.com> escribió en el mensaje
> news:%23eeq5B9BFHA.2380@tk2msftngp13.phx.gbl...
>> Hi!
>>
>> On several occasions I've had the need to call functions in Visual Studio
>> that take optional parameters, such as TextSelection.Delete(int). In VB
>> macro code I can do the following:
>>
>> Dim td As TextDocument = ActiveDocument.Object
>> td.Selection.Delete()
>>
>> But if I include that into C# add-in code, I get a compiler error: No
>> overload for method 'Delete' takes '0' arguments
>>
>> If I instead try (which I thought was the recommended method)
>>
>> td.Selection.Delete(Type.Missing);
>>
>> then I get this instead:
>>
>> The best overloaded method match for 'EnvDTE.TextSelection.Delete(int)'
>> has some invalid arguments
>> Argument '1': cannot convert from 'object' to 'int'
>>
>> So my question is: What is the correct way to call functions with
>> optional arguments from C# add-ins?
>>
>> Failing that, maybe someone has a tip of how to delete text between two
>> points?
>>
>> Thanks,
>>
>> Emil
>>
>>
>
>