function SaveDoc(writeProtected: Boolean): LongBool; stdcall;
HRESULT _stdcall SaveDoc([in] VARIANT_BOOL WriteProtected, [out, retval] VARIANT_BOOL* Value);
This function will save the loaded document to its original place and filename. The existing orginal file will be deleted. If you set WriteProtected to True, the write protect attribute of the file will be set. The function will return True if the file was saved successfully and False if the file could not be saved (e.g. because the orginal file could not be deleted or it was loaded from a read-only media). You can also call SaveDocTo in place of SaveDoc.