Loads a document, and sets it as the current document. If the document is already loaded, then it is simply set as the current document.

Synopsis

result = EditOpenDoc(name, closeWhenDone)

Args

name is the filename of the file. If an empty string, then the file dialog is presented. If omitted, then a new editor window is created with a default name.

closeWhenDone is 1 if the window is automatically closed when your macro ends. If omitted, then the window remains open after your script ends.

Returns

An empty string if successful, or an error number/message otherwise.

If you pass a docName, then it checks if that specified document is open in some editor window, and selects it as the current document (ie, the document that subsequent commands operate upon).

Notes

A macro cannot select itself as the current document.