Macro Security Level.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

How can we programmatically check or change the Macro security level in
PowerPoint?

Thanks in advance.
 
Thanks for the reply. But, I want to check or change the macro security level
"programmatically".
 
I was wondering why someone named technoknight was asking that question. I'll
turn this one over to the macro/VBA gurus...
 
I doubt very much if you can do what you want. I know I would not want some
presentation changing the security level of my program. That would defeat
the whole purpose behind security levels.

--
<>Please post all follow-up questions/replies to the newsgroup<>
<><>Email unless specifically requested will not be opened<><>
<><><>Do Provide The Version Of PowerPoint You Are Using<><><>
<><><>Do Not Post Attachments In This Newsgroup<><><>
Michael Koerner [MS PPT MVP]


| Thanks for the reply. But, I want to check or change the macro security
level
| "programmatically".
|
|
|
| "Sandy" wrote:
|
| > Tools > Macro > Security. Select desired level (this is PPT 2002/2003).
| > --
| > Sandy Johnson
| > Microsoft Certified Office Specialist (MOS PowerPoint)
| >
| >
| > "technoknight" wrote:
| >
| > > How can we programmatically check or change the Macro security level
in
| > > PowerPoint?
| > >
| > > Thanks in advance.
 
Here's some help copied out of the VBA Help files

MsoAutomationSecurity can be one of these MsoAutomationSecurity
constants.
msoAutomationSecurityByUI Uses the security setting specified in the
Security dialog box.
msoAutomationSecurityForceDisable Disables all macros in all files
opened programmatically without showing any security alerts.
msoAutomationSecurityLow Enables all macros. This is the default value
when the application is started.

check Help in VBA under MsoAutomationSecurity. There's even a code
snippet for you.

Brian Reilly, MVP
 
I second this, Michael. The entire purpose of the macro security level is
to restrict code from running without the user's permission. Having it
authorize itself would be like shooting yourself in the Buster Brown's --
somewhat self defeating.

Besides, if the security setting is set to High, than the macro that wants
to change the level won't be able to run anyway.


--
Bill Dilworth
A proud member of the Microsoft PPT MVP Team
Users helping fellow users.
http://billdilworth.mvps.org
-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
vestprog2@ Please read the PowerPoint FAQ pages.
yahoo. They answer most of our questions.
com www.pptfaq.com
..
 
Depends on what you need to do? If you are using one of the later version,
the UI macro setting has no effect on the automation security which is
control by the automation security level. So if you are running the code
from an external program you can set the automation security level as
desired and then programmatically open the presentation. However if the code
resides in a PPA/PPT then you are still ruled by the UI security level when
the host (file containing the code is opened) and only if the macros are
enable with the code in the host run.


--
Regards,
Shyam Pillai

Animation Carbon
http://www.animationcarbon.com
 
Thankyou all for the replies.

@Bill: I did read that code that you mentioned but was unable to see any
change in the security level. I guess, as Shyam said, they don't have any
effect if the code is contained within the PowerPoint. I am trying to change
it thru external app now.

@Shyam: Thanks for the info. I will try to change the security setting from
an external app.

Thanks & Regards,
Technoknight
 
Or if the user is using the viewer <g>




|I second this, Michael. The entire purpose of the macro security level is
| to restrict code from running without the user's permission. Having it
| authorize itself would be like shooting yourself in the Buster Brown's --
| somewhat self defeating.
|
| Besides, if the security setting is set to High, than the macro that wants
| to change the level won't be able to run anyway.
|
|
| --
| Bill Dilworth
| A proud member of the Microsoft PPT MVP Team
| Users helping fellow users.
| http://billdilworth.mvps.org
| -_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
| vestprog2@ Please read the PowerPoint FAQ pages.
| yahoo. They answer most of our questions.
| com www.pptfaq.com
| .
|
| | >I doubt very much if you can do what you want. I know I would not want
some
| > presentation changing the security level of my program. That would
defeat
| > the whole purpose behind security levels.
| >
| > --
| > <>Please post all follow-up questions/replies to the newsgroup<>
| > <><>Email unless specifically requested will not be opened<><>
| > <><><>Do Provide The Version Of PowerPoint You Are Using<><><>
| > <><><>Do Not Post Attachments In This Newsgroup<><><>
| > Michael Koerner [MS PPT MVP]
| >
| >
| > | > | Thanks for the reply. But, I want to check or change the macro
security
| > level
| > | "programmatically".
| > |
| > |
| > |
| > | "Sandy" wrote:
| > |
| > | > Tools > Macro > Security. Select desired level (this is PPT
| > 2002/2003).
| > | > --
| > | > Sandy Johnson
| > | > Microsoft Certified Office Specialist (MOS PowerPoint)
| > | >
| > | >
| > | > "technoknight" wrote:
| > | >
| > | > > How can we programmatically check or change the Macro security
level
| > in
| > | > > PowerPoint?
| > | > >
| > | > > Thanks in advance.
| >
| >
|
|
 
I tried this in my external application:
----------------------------------------------------------------------
Dim secAutomation As MsoAutomationSecurity
Dim App_ as PowerPoint.Application

secAutomation = App_.AutomationSecurity

App_.AutomationSecurity = msoAutomationSecurityLow
---------------------------------------------------------------------------

But, it doesn't seem to make any difference. Whenever I read the value of
App_.AutomationSecurity (before this code) then it always comes out to be 1
i.e. msoAutomationSecurityLow even when I have setted the Macro->Security->
Very High in PowerPoint.

Any idea what I am doing wrong?

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

Back
Top