Counting how often a document is being opened/previewed

Good morning,

I have been looking around for an example how to count how many times a document has been opened/previewed. I would say this is a pretty easy task but still haven’t been able to make a simple count +1 function… :-o

I have a field, e.g. count on a form which should contain this number. Where should the number be calculated? In the field itself as Computed when Composed or in the PostOpen of the form?

Can somebody please take my hand and guide me here…

Many thanks.

Kjeld

PS. Need another counter for every time a document is forwarded - guess that is the same.

Subject: Counting how often a document is being opened/previewed

I guess it depends on how much information you want. I had a situation where we were trying to figure out who was using what view and how many times they did it. So I hung some code on the view queryopen (in your case the Form QueryOpen) this code created a document the contained fields to store the User Name, the view name, date and time and then sent that to a mail-in DB. In that database I created a few views that allowed me to see what I needed. We only added it for awhile to see what was happening. After we got the information we needed we removed the code because it does add a bit to the server load depending on the frequency of hits.

Subject: Counting how often a document is being opened/previewed

It probably won’t work to have the counter field in the document itself, because you’ll have to dance around the fact that it’s being opened in read mode. Perhaps you can dodge around that if it’s opened normally from a view, but what about doclinks?

So I think you need PostOpen code which will update a counter in another document. Sort of a shadown counter document.

sorry,

raphael