How can I know if a document is opened in read-only mode?

I need to know, using a formula, if a document is opened in read-only mode (when i use the notesUIWorkspace.EditDocument method with notesDocumentReadOnly set to True).

This is my problem:

I don’t want to show an action if the document is opened in read-only mode.

So, the action must be showed only if the document is not opened in read-only mode.

Thanks.

Subject: How can I know if a document is opened in read-only mode?

How about @IsDocBeingEdited?

Katherine

Subject: RE: How can I know if a document is opened in read-only mode?

@IsDocBeingEdited says me if a document is opened in read or write/edit mode.I need to know if the document is opened in “read-only” mode…

I need to know if I can edit the document

When a document is opened in read-only mode i cannot edit it with doubleclick or CTRL+E (etc.)

Bye.

Subject: hiding actions…

You say “I don’t want to show an action if the document is opened in read-only mode.”

For each action button you can set the hide when properties, as shown below. So you can hide actions when the document is being read vs being edited. For example, you don’t want to show “Save and Close” as an action when the document is only being read.

Subject: RE: hiding actions…

yes, I know…but I need “the Formula” that hide my action button when a document is opened in “read-only” mode.

Maybe I didn’t explain well my problem.

I open a document using the EditDocument method with “Readonly”.

Which formula could I use to hide an action button when a document is opened in “read-only” (not read or write/edit mode) mode?

Bye, Antonio.

Subject: How can I know if a document is opened in read-only mode?

The fields $Writers and $WritersDate are available when a document is opened for editing.

Subject: How can I know if a document is opened in read-only mode?

Antonio,

To do what you’re intending, you’ll need to integrate your ACL and authors fields into your hide when formula.

You’ll need to examine the ACL of the database and test for all members of the ACL with author or higher access. You’ll also need to examine that particular document for any authors fields it may contain - if a document contains an authors field and the user (or a group or role in which the user is a member) is not in it, he or she can’t edit the document.

I hope this helps. If you need some sample code let me know and I’ll be happy to put some together for you.

Subject: How can I know if a document is opened in read-only mode?

Since you are opening the document in LotusScript as “read-only” that means that you have an object representing the back end document. I think that you could add a field named “tmpReadOnly” to the doc before you open the ui doc and then use a hide-when formula that tests for that field. You want to mark the tmpReadOnly fields as “do not save to disk” so that it is never stored in the document.