Create an Initialize event script for your document and put x=1 in it.
The bebugger will stop there when the document is opened.
Scroll to the appropriate event or events and put a break point into them.
Go back to the initialize event and click the continue or step into button.