A database must be open to a document view and the view must contain the document you want to open.
So if you are calling it from a form, using formula, you need to open the view where the parent resides, call openDocument, re-open the view and close it (so that you do not have a view opened).
Text (“1” or “0”). Optional. A value of “1” opens the document in Edit mode. A value of “0” (the default) opens the document in Read-only mode. "
You’ve specified Write as your first parameter. This is probably only going to work if you’ve got a field called Write on your form which has a text value of either 1 or 0. Is this the case? If not, you need to change your formula so that the first parameter is “1”