Most of `openDocAsSaveAll` is duplicated from `openDoc`. What's wrong with `openDoc` ? 

Why do you need to open files in the middle of an operation that save files that are *already* opened ?