Writer

Remember, always import library.

import easymacro as app

Current doc

doc = app.active
app.msgbox(doc.type)