generateOfficeDoc will only generate a document if the script size > 0