NotebookSelection
represents the current selection in the current evaluation notebook in the front end.
Details

- NotebookSelection takes a NotebookObject as an argument.
- You can use Options and SetOptions to read and write options associated with your current selection.
Examples
open allclose allBasic Examples (1)Summary of the most common use cases
Select some text and then set a font option for it:

https://wolfram.com/xid/0rs8myr2a-djvh4y

https://wolfram.com/xid/0rs8myr2a-cnmtmm

https://wolfram.com/xid/0rs8myr2a-nl8qr
Find out the option settings for the selected text:

https://wolfram.com/xid/0rs8myr2a-mlwd6a

Scope (2)Survey of the scope of standard use cases
Apply a named style to a selection:

https://wolfram.com/xid/0rs8myr2a-dcea10

https://wolfram.com/xid/0rs8myr2a-ncpl6x
Set an option for selected graphics:

https://wolfram.com/xid/0rs8myr2a-77vy

https://wolfram.com/xid/0rs8myr2a-ey8cwz

https://wolfram.com/xid/0rs8myr2a-dch9u
Properties & Relations (1)Properties of the function, and connections to other functions
You do not need to use NotebookSelection with most notebook-manipulating functions:

https://wolfram.com/xid/0rs8myr2a-enadtw

https://wolfram.com/xid/0rs8myr2a-1gg0u

Wolfram Research (1996), NotebookSelection, Wolfram Language function, https://reference.wolfram.com/language/ref/NotebookSelection.html.
Text
Wolfram Research (1996), NotebookSelection, Wolfram Language function, https://reference.wolfram.com/language/ref/NotebookSelection.html.
Wolfram Research (1996), NotebookSelection, Wolfram Language function, https://reference.wolfram.com/language/ref/NotebookSelection.html.
CMS
Wolfram Language. 1996. "NotebookSelection." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/NotebookSelection.html.
Wolfram Language. 1996. "NotebookSelection." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/NotebookSelection.html.
APA
Wolfram Language. (1996). NotebookSelection. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/NotebookSelection.html
Wolfram Language. (1996). NotebookSelection. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/NotebookSelection.html
BibTeX
@misc{reference.wolfram_2025_notebookselection, author="Wolfram Research", title="{NotebookSelection}", year="1996", howpublished="\url{https://reference.wolfram.com/language/ref/NotebookSelection.html}", note=[Accessed: 25-March-2025
]}
BibLaTeX
@online{reference.wolfram_2025_notebookselection, organization={Wolfram Research}, title={NotebookSelection}, year={1996}, url={https://reference.wolfram.com/language/ref/NotebookSelection.html}, note=[Accessed: 25-March-2025
]}