もっと前のステップでエラーになっているのではないでしょうか。 Set maildoc = db.Createdocument() は Set maildoc = maildb.Createdocument() の間違いでは?