Save document when load file.