This is a continuation of my "Word Automation: OLE exception error 5981 in
Windows 7" thread.
Thanks to some great help from many of you, so far I have accomplished the
following:
1. I established that my Word 97 automation system works fine in Windows XP
once I make sure a required .bmp file is present in the path.
2. With most of the Windows 7 UAC security policies disabled or set to the
loosest possible values, my Word 97 automation code now runs correctly, as
originally written, in Windows 7, when using a Domain Administrator
account. The program runs correctly in the IDE or as a compiled .exe file.
3. After learning that after setting the Word 97 "mode" back to Win 98, I
could not longer do things like "Save As...", I reset it to run in Windows
7 mode. That doesn't affect my automation code at all in my Domain
Administrator account.
4. After changing the UAC policies I also find that I don't need to have
Word set to "run as administrator" in order for the automation to work in
my Domain Administrator account.
5. I do not need to run my application "as administrator" either in order
for it to work when using my Domain Administrator account.
Now the problem is to get this program to work for a restricted user on
Windows 7.
A Windows 7 restricted user cannot open the Visual Basic editor in Word 97
no matter what combination of "compatibility modes" are in effect, not even
if Word is set to "run as administrator".
If I run my .exe in the restricted Domain User account in Windows 7, I get
the "Could not open macro storage" error on .documents.Add, again, no
matter what combination of "compatibility modes" are in effect, and
regardless of whether the .exe is run "as administrator".
Making the user a "Power User" has no effect on this issue.
There is no local security policy setting that lets me say "restricted
users can have programs 'elevated' automatically without prompting", the
way I can for adminstrators.
However, even with the "User Account Control: Behavior of the elevation
prompt for standard users" item set to "Prompt for credentials", when the
Word 97 automation code is encountered, there is no prompt. Instead, the
object reference to the "Word.Application" object is successfully created,
and then I get "could not open macro storage" on .documents.Add. What is
notable about this was, before I disabled prompts and confirmations for
administrators, I would get a different error, "operation requires
elevation", on the CREATEOBJECT("Word.Application") call when running in
my Domain Administrator account.
Some digging in Microsoft publications on UAC brought up an article that
suggested that if I could find a Class folder for the Word automation
object in the registry, I could give it a new key called "Elevation" with a
DWORD variable called "Enabled" set to 1. However, I couldn't find any
appropriate Class in the registry for Word.
So. Does anyone have any suggestions on how I can force Windows 7 to let a
restricted user a VFP 9 SP 1 .exe that contains Word 97 automation code?
Thanks very much.
Ken Dibble
www.stic-cil.org
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message:
http://leafe.com/archives/byMID/profox/[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the
author, and do not constitute legal or medical advice. This statement is added
to the messages for those lawyers who are too stupid to see the obvious.