Welcome Guest Register Login Search The Forum Display List of Forum Members
 All Forums
  OutlookFUSE (Forum Locked Forum Locked)
 
Subject Topic: Office 2007 and exclusive access ? Post Reply Post New Topic
Message posted by Dave Beggs on 02 December 2007 at 3:15pm
View Dave Beggs's Profile Profile   Search for other posts by Dave Beggs Search   Quote Dave Beggs Quote   Send Private Message Send Msg  
Dave Beggs
Standard Member
Standard Member
Australia
28 November 2007
12 Posts

Hi Steve

Sorry to be such a prolific poster - thanks for your help so far - I have the nuts and bolts working pretty well now. 

One bit of a problem ...

I am running Vista Business and Office 2007.

It seems that with this combination, Outlook must be closed for Outlook-Fuse to access it.  If a window is open in Outlook, OutlookFuse comes up with a "Server Execution error".  Closing any Open Outlook windows solves the problem. 

Whilst inconvenient, I can change the "Server Execution Failed" message to "Please Close Outlook", but it would be much neater to fix it ;)

The reverse is also true though - whilst the window that called Outlook Fuse is open, Outlook does not respond - Clicking the Outlook icon to open it has no effect.

It seems that either the console or Outlook Fuse can access Outlook, but not both  ?!

This reproducible in both the example apps.

It works fine on Windows XP with Outlook 2003.

Do you think there is likely to be anything we can do about this ?

Cheers

Dave Beggs


Message posted by steve_johnson on 02 December 2007 at 5:54pm
View steve_johnson's Profile Profile   Search for other posts by steve_johnson Search   Visit steve_johnson's Homepage www   Quote steve_johnson Quote   Send Private Message Send Msg  
steve_johnson
Avatar
Forum Moderator
Forum Moderator
United States
13 April 2002
274 Posts

Hi Dave -

The "Server Execution Failed" is probably coming from the error returned from CreateInstance (this is a guess since my configuration differs from yours).  Are you using the AttachExisting method call to attempt to automate the existing instance of Outlook or is this a fresh CreateInstance?

Maybe if you provide a little code snippet - I'm not sure if this is a Vista / Office 2007 security related issue or something different but I'm sure there's a way to work around it.



-------------
Steve Johnson
ThinkData Inc.
http://www.thinkdata.com

Message posted by Dave Beggs on 02 December 2007 at 9:29pm
View Dave Beggs's Profile Profile   Search for other posts by Dave Beggs Search   Quote Dave Beggs Quote   Send Private Message Send Msg  
Dave Beggs
Standard Member
Standard Member
Australia
28 November 2007
12 Posts

Yep.  It's the CreateInstance that's failing.

The code (which may look familiar!) is


    hr = Outlook1.AttachExisting(address(CLSID_Application), address(IID__Application))
    if hr ~= S_OK_PW
      hr = Outlook1.CreateInstance(address(CLSID_Application), |
           address(IID__Application), bor(CLSCTX_LOCAL_SERVER_PW, CLSCTX_INPROC_SERVER_PW))
 
      if hr ~= S_OK_PW then ShowCOMError(hr);return(level:fatal).
      fCloseOutlook = true
    end

The interesting thing is that if I compile and run the example olimpexp.app I see the same thing as my app - If another instance of Outlook is open, I get a server execution error.

However, if I compile the example olfuse.prj then I see the same code, but different behaviour - it works perfectly !  I can use Outlook and olfuse.exe together, but Olimpexp fails when olfuse is running. (Does this make sense?)

I'm wondering if  I need to pass different paramaters to the createinstance procedure when running from a window that run from an application frame ?

 

 


Message posted by Dave Beggs on 03 December 2007 at 2:53pm
View Dave Beggs's Profile Profile   Search for other posts by Dave Beggs Search   Quote Dave Beggs Quote   Send Private Message Send Msg  
Dave Beggs
Standard Member
Standard Member
Australia
28 November 2007
12 Posts

Here I go again, talking to myself ...

I found the answer, which may be of interest to anyone watching...

It seems that under Vista UAC, CreateInstance will fail if the integrity level of the app attempting the createinstance and Outlook are not exactly the same.

if my application is run as administrator whereas Outlook runs in protected mode, or my application is run in protected mode whereas Outlook run as administrator, in both cases CreateInstance fails. For this reason, My app even behaves differently when run from the C6 IDE than when it is run from explorer.

If both my application and Outlook are run in the same integrity level, everything is fine.

If Outlook is closed, then Createinstance causes Outlook to run with the same integrity level (by definition) so all is well.

I'm not sure there is an easy answer to this (other than providing documentation to vista users).  A google search reveals that this is not a particularly uncommon problem.  People are trying to get hold of and change the level of the Outlook token without much success.

Maybe Steve will work it out <g>!

Cheers!

Dave Beggs

 


Sorry, you can NOT post a reply.
This forum has been locked by the forum administrator.

Forum Jump Post Reply Post New Topic
Printer Friendly Version Printable version