Publics variables

Hi Everyone,
I need to know if I can use publics variables to stop to declare ans assign them in each subs. Like :

Public doc as object
doc = ThisComponent

and after I want use it in all subs , in Standard-Module1 AND in the Librairy1

If I can where to declare and assign them.
Other question when Sub Main is called?

Thanks

short anwser : no.

never implicitely, you can even drop it. Using Procedures, Functions or Properties