Victor, one other possible cause is that you are calling GetDocument in a wrong place, e.g. in the view's class constructor.

// just looking in my crystal ball...