How can I check the welcome Document

My code runs in welcome Document then my coreldraw will be stopped.

I print corelApp.ActiveDocument.GetType(), but it will be stopped either.

How can I check welcome Document to set my code can't be used?