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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

disableing right mouse click in Word97

Status
Not open for further replies.

ninash

Technical User
Jul 6, 2001
163
GB
Hi
can anyone tell me how to disable the right mouse click function in Word 97.

Thanks in advance
Tony
 
Hi Chance

Word is only being used to display a document. I have turned off all controls to stop anyone do anything else but the right mouse click seems to use another type of control.
The main reason for this modification is security on the server it is being run.

Regards
Tony
 
I dont think(could be wrong) there is away of disabling right click, and i think also that would cause problems for users who flip their mouses if there is an API call to do it and for users who use the accesibility features.

I presume you dont want the user to be able to change anything on the document, if so there are steps you can take or ultimatly create a PDF version of the file and you wont have any problems

Filmmaker, gentleman and i have a new site 3/4 working

 
Hi
The real problem is if the user wants to be malicious they can by way of the right click delete files from the server.
I know this sounds like an IT department problem but since I wrote the database and that database displays documents in word they have passed this problem over to me to sort out. If it is not possible to turn of the right click then I am well and trully stuffed.

Tony
 
It is the server that needs protecting ....
The document being displayed is neither here or there.
By a simple process of guessing a not even very clued up user could get somewhere where and as long as the file names are displayed they will be able to do some serious harm.

I wish this company had not got involved in citrix
 
You may also consider using the free Word viewer from M$.

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
Hi Tony,

I don't think you can disable the right mouse click itself, but you can disable the popups which it activates. For example ..

Code:
[blue]Application.CommandBars("Text").Enabled = False[/blue]

Trouble is that right clicking is context-sensitive so you may want to disable a lot of menus. This will disable all popup menus ..

Code:
[blue]For Each cb In Application.CommandBars
    If cb.Type = msoBarTypePopup Then
        cb.Enabled = True
    End If
Next[/blue]

Enjoy,
Tony

--------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.
 
This will disable all popup menus ..
TonyJollans, I guess you meant:
cb.Enabled = False
instead of:
cb.Enabled = True

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
I did, indeed!! Well spotted!

I would agree with Chance, however, that the real issue here is security on the server and the wet fish solution is the correct one.

Enjoy,
Tony

--------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.
 
Thanks for all your help guys
And as for the wet fish.... Well what can I say the people here don't see the line between server and software and no matter how big the fish it still wouldn't change a thing.

I couldn't get your code (Tony) to turn off the right clicks on toolbars in word 97 and now I am off to find a very tall building.

Thanks anyway
 
Hi Tony,

Interesting. That particular toolbar doesn't seem to be a member of the collection. To explicitly disable it, try ..

Code:
[blue]Application.commandbars("Toolbar List").enabled = False[/blue]

Enjoy,
Tony

--------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.
 
OK the story is this so far
I changed how the documents are loaded into word and edited the normal.dot allowing me to disable all the toolbars and shortcut keys that I needed to disable. Everything was cool until I discovered that if a loaded document is changed word prompts the user to save the document. This opens the chance for system corruption again.

Question...
Are either of the 2 operations possible with code within word?
1. to disable the save function even if the document has been changed.
2. to turn off the Close button (X) on the document allowing the exit that I give the program to have a macro that will exit and ignore the unsaved document.

Any help as always is very welcome.

Tony
 
Hi Tony,

If your Users have write access to your server, they can write to it, period; it has nothing to do with your document. That said, you can override any Word command; full details are available from Micro$oft

Enjoy,
Tony

--------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.
 
blimey i know you can get rid of the close button , but thats a hefty bit of an API Call, i'll try and dig it out for you.


re the save there should be something like application or document .savechanges = true this will then trick word into thinking the document has already been saved and wont prompt again,.

Filmmaker, gentleman and i have a new site 3/4 working

 
Hi Tony
If it comes down to Disabling Save then the FAQ I pointed you to in another thread would cover a number of the methods you will need to use.

In addition to that the following code in your document should prevent the user being asked to save the document

Code:
Private Sub Document_Close()
ThisDocument.Saved = True
End Sub

In addition to my FAQ I have been chatting to fumei off site. He has told me of a template that is available from M$ that disables ALL word commands. I haven't tested/looked at this but the description seems to suggest not only slapping someone with a fish but with a number of fishes - still in their tins!!

However, be careful with this template. fumei's words
"WARNING!!! Do not open this file unless you have the VBA Editor open! It literally overrides everything - including being able to close it. So to close it you must disable the, well, disable functions."

As it sounds like you are trying to override all functionality in Word, this may be the solution.

You can get the file from this link, apparently

As for disabling the "x" button if you do a google search or even search this site you'll find hundreds of links. Check the FAQs for the VB forum as there may be something there.

Good Luck!
;-)

If a man says something and there are no women there to hear him, is he still wrong? [ponder]
The faqs ma'am, just the faqs. Get the best from these forums : faq222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top