Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Word Automation - Setting Macro Security Level
Message
From
31/07/2003 15:47:24
Fabian Belo
Independent Developer
Argentina
 
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00815165
Message ID:
00815590
Views:
7
Thank you Yuri. I'll let you know.
BTW,
oWord.APPLICATION.activate
is always throwing "OLE IDispatch exception code 0 from Microsoft Word: Cannot activate application...
(Office XP-SP_All)


>There is a setting for the VB Project Protection. If you go to VB editor (Alt+F11)-> Tools->Project Properties->Protection, then you can set (manually) the desired Lock state and the password.
>
>I was not able to find how to set the project protection properties programmatically, as I see them read only,
>
>?oWord.APPLICATION.VBE.VBProjects("Project").protection
>
>However as a temporarty solution you can use a sendkeys() that works for me for Word97, like:
>*---------------------------
>LOCAL oWord
>oword=GETOBJECT(,"Word.Application")
>oWord.WindowState=0
>oWord.APPLICATION.activate
>* invoke VB Editor, project protection dialog, set lock on, set password YY, confirm password YY, close dialog, close VB Editor
>oWord.Wordbasic.Sendkeys("%{F11}%Te+{TAB}{RIGHT}{TAB}={TAB}YY{TAB}YY{ENTER}%FC")
>oWord=.null.
>*----------------
>
>The key string may vary for different Word Versions.
>Please, let me know if you find the way to set project protection programmatically.
>
>Thanks
>
>>Dear all;
>>
>>After the usual: oword=createobject("Word.application")
>>Is there any way (method) to set this value? (Tools-Macro-Security)
>>
>>Any hints and/or links will be greatly appreciated.
>>Thank you,
"Since I've read that alcohol is bad... I quit reading."
Me


http://www.fabianbelo.com.ar
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform