Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VBA Autoopen Macro to control file menu
Message
 
To
02/08/2007 09:12:07
General information
Forum:
Microsoft Office
Category:
Word
Miscellaneous
Thread ID:
01245451
Message ID:
01245750
Views:
21
>I would like to know if the following is possible and if so how?
>
>1. If the file is opened read/only (i.e. from Visual Foxpro 9) disable all items in the file menu except Page Setup for Printing, Print, and exit.
>
>2. Only allow specific users to be able to modify the file and save it (based on user login id)?

Helle Claude,

per your #1:

From VFP9 you can control the behavior of Word commandBArs, like:

oword=createobject("Word.Application")
oword.CommandBars("Menu Bar").Controls("Edit").enabled=.f.
oword.CommandBars("Menu Bar").Controls("File").controls(1).enabled=.f.

etc..

But it will set this behavior on the global level, and not temporaraly, and not for particular document, so you need to recall all original settings upon closing the document.


per your #2:
Do you wish to control the behavior while opening the document for user in VFP, or from Word? If it is for particular file then anyway you can add AUtoOpen and AutoClose macros, where you need to check for user id, and set pernissions, enabled/enabled, etc depending on it.

Probably you may also apply another approach based on the password requered for opening the document in particular mode, and give the password to particular users only.


Good Luck
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform