Disable Printing while in edit mode but enable printing in read mode (non-web)

In Notes 5.07.
I need to disable the documents from printing in edit mode but want to enable printing in read mode.
I tried putting $KeepPrivate as "1" or "0" in querymodechange and postmodechange event of form. I don't know what i am doing wrong but it didnot work. Please suggest. Any API function would greatly help too.

Thanks !
navgupAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

AndrewJayPollackCommented:
Navgup, I think to do this you'll have to trigger a form reload - a closing of the window and re-opening of it through your code in order for the client to recognize your changes to the $keepprivate field..
0
pratiganCommented:
YOu can also use the @[RefreshAllDocs] to reload all the  documents.  I at times setup a view to display just the documents I want ot refresh and then run an agent that contains the refreshalldocs or refreshselecteddocs..
:)
0
AndrewJayPollackCommented:
That will work in a view, or on the database as a whole, but not while looking at a single document in and wanting its value to update.

@Command([ViewRefreshFields]) MIGHT work, I haven't tried it, but I suspect he's going to need to close and reopen the uiworkspace document itself.
0
Cloud Class® Course: CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

pratiganCommented:
Hello Andrew,
I agree with you if he's having a problem with one document.  I was under the impression he has multiple documents already created that he needed to add this change to.
Thanks !
Paul
0
navgupAuthor Commented:
Thanks for the input. but nothing helped so far. Any other suggestions.
0
AndrewJayPollackCommented:
the changemode event gives you source as notesuidocument right?

so, if the document is in read mode, do this:

source.close()
source.open(true)

if its in edit mode, do this:

source.close()
source.open(False)
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
navgupAuthor Commented:
No help.. still finding difficult to set the values on the fly..
0
AndrewJayPollackCommented:
unfortunately, changing this value takes no effect unless the document is reloaded.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Lotus IBM

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.