Activate doc before executing.