how to dertect who is running application

D

Dennis S

I have a vba WORD solution which includes a global template add-in (stored in
a WORD template) that stores all the code for the solution. The solution is
used by multiple users at once. The problem I have is when I need to replace
the template with software changes. If any user is currently accessing the
global template, then I am locked out until the user(s) log out of WORD. Is
there any way I can determine what user(s) have the template locked?
 
A

Anne P.

Basically, any user who has Word open, whether they are currently working on
a document at all, then you are locked out. It has been my experience that
when a company needs to make changes to the global template, you would have
to one of two things:

1. Notify all users (maybe by e-mail) that they must exits Word until you
have downloaded the changes. However, this could backfire because someone
could be in a meeting with Word open and not see the e-mail.

2. The preferred method used by most companies is to use a logon script.
Whenever a user logs on to the network, the script would check the user's
startup location to see if they have the lastest version of the template.
If not, the script would copy the lastest version down to the user.

Anne P.
 
D

Doug Robbins - Word MVP

This was posted a while back:

----- Original Message -----

From: "Chad DeMeyer" <cjdemeye at bechtel dot com>

Newsgroups: microsoft.public.word.vba.addins

Sent: Thursday, August 12, 2004 4:10 PM

Subject: Re: Need to change how we distribute firm templates?


Colleen,

Using a logon script to copy latest version of add-in templates to StartUp
folder is probably the best solution for the templates containing

macros, etc. However, I would answer your objection to using the

Templates location for the other templates with this:

When a user has a document created from one of those templates open and

are connected to the network, a file lock is in fact created that prevents
the template itself from being opened with Modify access. However, these
file locks can be released, with no adverse affect to the end users who
created them, by using any of a number of standard utilities that close

resources on a network. The only catch is that the person using the

must have adequate permissions on both the network share and the Workgroup
Templates folder itself, in other words Admin rights. On my Windows 2000
box, I can do this through the UI with Start>Settings>Control
Panel>Administrative Tools>Computer Management>Action>Connect to another
computer... type name of network server>System Tools>Shared Folders>Open
Files, find any open resources for that template, right-click and select
'Close open file'. Even easier is to use the command line utility OFL,
which when used with the right switches will automatically close any open
resources connected to a specified template.


Chad


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
D

Dennis S

Thanks for the input.

Option #1 is not useful since, as you mention, the person who is logged into
WORD on the network and using the global template may be at a meeting. Also,
it is a maintenance issue since not all users on the network using WORD are
using the global template. The globla template is an add-in to a custom
solution of an instance of WORD initiated by a user.

Option #2 may be helpful. Actually a variation of it may be more helpful.
When a user starts the customized solution, I could write their login and
name into a text file. When they exit the customized solution, it would
remove their name from the text file. Any names in the file would be those
using the customized solution.

Is there any system level API that could send back this information? It
seems WORD knows the users who have a hook on the global template. The
question is how do I access this info from the system?

Thanks....
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top