This is documentation for Mathematica 8, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.1)

EvaluationNotebook

EvaluationNotebook
gives the notebook in which this function is being evaluated.
Get the current NotebookObject notebook being evaluated:
Use the object for further processing:
Get the current NotebookObject notebook being evaluated:
In[1]:=
Click for copyable input
Out[1]=
Use the object for further processing:
In[2]:=
Click for copyable input
Out[2]=
Create a palette button that writes to the input notebook and then closes the palette:
The notebook that starts an evaluation might not be the input notebook:
Moving the selection in the evaluation notebook does not change the output cell location:
New in 3