This property is only valid for certian types of windows, such as text editor windows, but not for other window types such as the task list or output window. If the Window object does not support the Selection property, then NULL, null, or Nothing, depending on your programming language's syntax, will be returned.