Home > Net >  Can I open Outlook from VBA without elevated privileges, eventhough Word is opened with elevated pri
Can I open Outlook from VBA without elevated privileges, eventhough Word is opened with elevated pri

Time:11-23

I ran into an issue with a VBA implementation in Word.

I would like to send an email upon the press of the Print button.

My code works fine when i open word without elevated privileges. However, I need the document to be opened with elevated privileges. And when I do so, the outlook app created is also opened with elevated privilieges, which works only when Outtlook is not currently running... my guess is that since Outlook's already opened without being elevated ( and I can't change that ), the app that is being created with this line of code

Set olApp = CreateObject("Outlook.Application")

interferes with the currently opened Outlook.

Do you know if it is possible to create an Outlook process within VBA in an elevated Word document, without it being elevated aswell?

Thank you.

CodePudding user response:

No, Outlook is a singleton, you cannot open more than once instance of Outlook for a given local user.

And if the security contexts differ, COM system refuses to marshal calls between two apps, so this is not even Outlook specific.

  • Related