Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to disable users from closing word2000?

Status
Not open for further replies.

edgarattec

Technical User
Jun 21, 2001
2
NL
Hi,

Currently i am porting a large access application from access2.0 to access2000.
The application is used to keep track of customers, logistics and users are able to create several types of documents (faxes, memo's, letters etc etc). It is also possible to read existing documents. The documents are opened with MS word. One problem with the old system is that once a user opend an existing document or created a new one and later on accidentally or on purpose closed word, the application lost its connection with word and the user had to restart the access application.

In the application word was started with the command:
Code:
  wordobj = createobject("word.basic").

The object wordobj is a global variable for the whole application.
First i ported the application to access97 and word97. I "solved" (actually is was more like a workaround than a solution) this by issuing the command wordobj,apphide. If this comnmand failed, i knew word was killed by the user, so i could restart it before opening or creating a document. This worked fine.

Now i have to move the application to office2000 and the problem is back again.
Due to the changed document interface of word2000 (changed from multiple doc interface to single doc interface) users get lots of items in the taskbar if they have many documents open. The users policy is to save all document and close word.

Now i have the following problem: the code wordobj.apphide succeeds (although word was closed there is still a winword process), the application "thinks" it has access to word, but if i use the property documents.count i get an error like "the server machine cannot be found or is unavailable". I have to manually remove the winword process and the access application, and most of the time even the PC must be restarted to get things working again.

What must i do?

1. remove the old declaration
Code:
 Createobject("word.basic")
and use
Code:
 CreateObject("word.application")
instead? if so, where can i find the equivalents of the methods/properties of word.basic and word.application

2. (preferred) can i start word but make it impossible for the users to kill it?

3. Any other ideas?

Any help would be greatly appreciated, I am struggling with this for some time and can't decide what to do.

Edgar.
 
Hi there,

you might wanna take a look at "preventing a user from closing an access 2000 runtime application" --> there the close button is disabled. if you get the window handle for word instead of access this should do the trick i think

good luck

cpu-burn
 
Hi cpuburn,

I'm quite new to tek-tips, so can you help me out where to find "preventing a user from closing an access 2000 runtime application" you are refering to?

Thanks again,

Edgar.

 
hi,

take advanced search, words:

"user access runtime application"

check all words

at the end of page one of the results there it is

cpu-burn
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top