Page 1 of 2 12 LastLast
Results 1 to 15 of 17
  1. #1
    3 Star Lounger
    Join Date
    Aug 2002
    Location
    Denmark
    Posts
    347
    Thanks
    0
    Thanked 0 Times in 0 Posts

    msoAutomationSecurity property (WinXP / O2003, Word)

    Hi,

    Here's a few questions that's puzzling me slightly, no big issues, just looking for some enlightning here...

    1. In O2003 there's 4 security levels - only 3 for automation, any good explanations for this?
    2. Under the AutomationSecurity property there seems not to be any possibility to set neither the "Trusted all installed add-ins and templates" nor the "Trust access to Visual Basic project " - any other ways of doing this or any explanations why not ??

    Any hints or explanations are very welcome...
    Bests,
    RD


    PS: Wish there were a knob on the TV to turn up the intelligence. There's a knob called "brightness," but that doesn't work

  2. #2
    Plutonium Lounger
    Join Date
    Nov 2001
    Posts
    10,550
    Thanks
    0
    Thanked 7 Times in 7 Posts

    Re: msoAutomationSecurity property (WinXP / O2003, Word)

    "Trust access to Visual Basic project " prevents VB code from manipulating other VB code. If you allowed it to be set from within VB it would completely defeat the purpose of having this option!

    StuartR

  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: msoAutomationSecurity property (WinXP / O2003, Word)

    1 - Does Microsoft Office Assistance: Macro Security Levels in Office 2003 help?
    2 - I hope not! It would be every hacker's dream if you could do that!

  4. #4
    3 Star Lounger
    Join Date
    Aug 2002
    Location
    Denmark
    Posts
    347
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: msoAutomationSecurity property (WinXP / O2003, Word)

    1. It's informative - though I'm aware of most of this... - thanks anyway for pointing it out
    2. Feared this would be the argument and I can fully appreciate and accept it, but I've also experienced that it prevented references set in and between .dot files from working...
    Bests,
    RD


    PS: Wish there were a knob on the TV to turn up the intelligence. There's a knob called "brightness," but that doesn't work

  5. #5
    3 Star Lounger
    Join Date
    Aug 2002
    Location
    Denmark
    Posts
    347
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: msoAutomationSecurity property (WinXP / O2003, Word)

    Is there then instead:

    1. A property regarding the "VB projects" that can be read (must be since it's a check box...) or
    2. a registry key that can be read or
    3. do I have to do this through error-trapping..?

    Thanks,
    Bests,
    RD


    PS: Wish there were a knob on the TV to turn up the intelligence. There's a knob called "brightness," but that doesn't work

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: msoAutomationSecurity property (WinXP / O2003, Word)

    What do you want to accomplish?

  7. #7
    3 Star Lounger
    Join Date
    Aug 2002
    Location
    Denmark
    Posts
    347
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: msoAutomationSecurity property (WinXP / O2003, Word)

    I've got some .dot's that launch from startup ao. adding a menupoint.
    From the menupoint other .dot's are called.

    But if security settings are set above "Medium" and the two "Trusted" checkboxes aren't checked, then the code fails.
    So already at the menupoint level I would like to check to what extend it's possible to run the called templates at all.
    Bests,
    RD


    PS: Wish there were a knob on the TV to turn up the intelligence. There's a knob called "brightness," but that doesn't work

  8. #8
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: msoAutomationSecurity property (WinXP / O2003, Word)

    The settings are in HKEY_CURRENT_USERSoftwareMicrosoftOffice11.0WordSe curity (the 11.0 is for Office 2003, Office XP would be 10.0 etc.)
    The macro security level is the Level value (1=Low, 2=Medium, 3=High)
    Trust all installed templates and add-ins is the DontTrustInstalledFiles value; if this doesn't exist 0 is assumed. (0 = trust, 1 = don't trust)

    You can use
    intLevel = Application.PrivateProfileString("", "HKEY_CURRENT_USERSoftwareMicrosoftOffice11.0WordS ecurity", "Level")
    to find the macro security level, and
    intTrustInstalled = Application.PrivateProfileString("", "HKEY_CURRENT_USERSoftwareMicrosoftOffice11.0WordS ecurity", "DontTrustInstalledFiles")
    to get the Trust all installed templates and add-ins setting.

    Note:
    Trust access to VB Project is the AccessVBOM value (0 = don't trust, 1 = trust), but this cannot be accessed from within VBA, for security reasons.

  9. #9
    3 Star Lounger
    Join Date
    Aug 2002
    Location
    Denmark
    Posts
    347
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: msoAutomationSecurity property (WinXP / O2003, Word)

    AccessVBOM - pitty, not even as a tiny weeny "read-only" ?

    Guess I then have to catch that event in an error trap - promting the user to check that specific setting?
    - or is there a clever workaround?

    Thanks,
    Bests,
    RD


    PS: Wish there were a knob on the TV to turn up the intelligence. There's a knob called "brightness," but that doesn't work

  10. #10
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: msoAutomationSecurity property (WinXP / O2003, Word)

    You'll have to trap the error. See Excel Developer Tip: Is Access to the VB Project Allowed? (this is for Excel, but it's similar for Word)

  11. #11
    3 Star Lounger
    Join Date
    Aug 2002
    Location
    Denmark
    Posts
    347
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: msoAutomationSecurity property (WinXP / O2003, Word)

    Can't find the "DontTrust..." key at all - neither where you mention.

    Tried to look under "SystemCertificates" and other folders as well - no luck.
    - are you sure about the path or can it be located elsewhere?
    Bests,
    RD


    PS: Wish there were a knob on the TV to turn up the intelligence. There's a knob called "brightness," but that doesn't work

  12. #12
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: msoAutomationSecurity property (WinXP / O2003, Word)

    The entry doesn't necessarily exist. If you read my reply above carefully, you'll see that it says that if the DontTrustInstalledFiles value is absent, it is assumed to be 0. If you CLEAR the "Trust all installed templates and add-ins" check box in the Trusted Sources tab of Macro | Security, the registry entry will be created with a value of 1.

  13. #13
    3 Star Lounger
    Join Date
    Aug 2002
    Location
    Denmark
    Posts
    347
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: msoAutomationSecurity property (WinXP / O2003, Word)

    You have a point.

    I have mine checked - what I overlooked was the "assumed to be 0" bit.
    That explains it.

    Thanks for pointing the direction / ;o))
    Bests,
    RD


    PS: Wish there were a knob on the TV to turn up the intelligence. There's a knob called "brightness," but that doesn't work

  14. #14
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Yilgarn region of Toronto, Ontario
    Posts
    5,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: msoAutomationSecurity property (WinXP / O2003

    Hans, thanks for the link.
    I migrated the code to WordXP (attached as a ZIP file) and test ran it for various combinations of Security={Low, Medium, High} and VBP {on, off} and Trusted {on, off}.

    If the AutoExec can run, a message prefaced "TestMacroSecurity" will appear, indicating that the template has program control (and thus we can do what we are allowed to do, but especially can offer advice to the end user). Such action is, of course, available to any SetUp.DOT installation routine.

    The only cases that don't permit the code to run/alert seem to be (WordXP/2002)
    Security=High, AddIns=Off, VBP=On
    and
    Security=High, AddIns=Off, VBP=Off

    Which reduces to:
    Security=High, AddIns=Off

    The problem thus seems to be, "How to detect {Security=High, AddIns=Off}?".



    I then trotted over to the Win98/Word97 machine, and noticed that changing the "disable macro" setting in Tools Options made a change in the registry (that appeared to be the only file changed on the hard drive relevant to the time of my action), but I am not smart enough to find the key (looked for "macro" and looked for "security").


    Cash flow being what it is, I have neither a 2000 nor a 2003 system, so I'd happily collaborate with anyone who has one and is interested in a generic chunk of code that will test a user's ability to run macros.

    I'm not interested in thwarting MS's security, but am keenly interested in being able to steer/advise the novice end-user.

    If all else fails I may end up with a VB6/EXE that can front-end the installation of a Word template, asking the end-user to fix settings before launching the installation proper.

  15. #15
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: msoAutomationSecurity property (WinXP / O2003

    I think instructing the user in some way to check the security settings (for example using a separate .exe) is the way to go.

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •