IVsTextView.GetWordExtent Method

Returns the current word extent.

Namespace:  Microsoft.VisualStudio.TextManager.Interop
Assembly:  Microsoft.VisualStudio.TextManager.Interop (in Microsoft.VisualStudio.TextManager.Interop.dll)

int GetWordExtent(
	int iLine,
	int iCol,
	uint dwFlags,
	TextSpan[] pSpan


Type: System.Int32

[in] Line index for the lines that contains the word.

Type: System.Int32

[in] Column index for the word.

Type: System.UInt32

[in] Flags specifying how the word extent is determined. For a list of dwFlags values, see WORDEXTFLAGS.

Type: Microsoft.VisualStudio.TextManager.Interop.TextSpan[]

[out] Span of text identifying the word extent.

Return Value

Type: System.Int32
If the method succeeds, it returns S_OK. If it fails, it returns an error code.

COM Signature

From textmgr.idl:

HRESULT IVsTextView::GetWordExtent(
   [in] long iLine,
   [in] CharIndex iCol,
   [in] DWORD dwFlags,
   [out] TextSpan *pSpan

The word extent is wherever the editor determines the word boundary to be. For example, if you place your cursor in within a word and then double-click, the core text editor assumes that the word extent is that entire word.

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
© 2014 Microsoft