0

I'm trying to access my outlook inbox message body via Python. However, it prompts me every time i make a call to it (to either allow to deny). The solution i found online was to edit the following registry.

HKEY_CURRENT_USER\Software\Policies\Microsoft\Office\xx.0\Outlook\Security

I have outlook 2013 (so xx.0 should be 15.0). However, I am unable to find this key. There is no 15.0 under the Office key.

Is there somewhere else I should look? Or do you know another method by which I can access outlook message body via python?

I'm running windows 7 enterprise edition

NOTE: I don't have admin access on this computer as it is a work computer.

Einzig7
  • 543
  • 1
  • 6
  • 22
Yousuf
  • 89
  • 2
  • 11

1 Answers1

1

First, consider that key may not be there because it doesn't need to be there. You don't have any policies currently, so there's no need for the keys. In other words, you'll need to create them.

Second, use ProcMon to watch your Outlook process and see exactly where it's looking for keys like this. You might need a SysWow64 somewhere in that path. Procmon's the quickest way to find out.

Finally, you should clarify which API you're using here. Likely choices are either Simple MAPI or the Outlook Object Model. If the latter, then the proper way to avoid security prompts is to keep you Antivirus up to date, since that's what Outlook checks before deciding to prompt. If you're using the OOM and getting prompts, you should check the Trust Center in Outlook to see if what it says about Programmatic Access.

If you're using Simple MAPI, then you will need to set one of the PromptSimpleMAPI* keys, as documented here.

Slipstick's page on programmatic access is your best resource on this.

sgriffin
  • 337
  • 1
  • 9
  • I am using simple MAPI. I tried to create the key myself but I think the admin restricted my access to the policies section. Ive been able to add keys in other areas but not under policies (or any sub keys of policies). Do you have any resources on the outlook object model? I will try that instead. – Yousuf Jul 12 '18 at 14:45
  • I'd just search on SO for Python and Outlook Object Model. This question looks like a decent starting place: https://stackoverflow.com/questions/50881700/how-to-get-a-specific-folder-with-getdefaultfolder-and-delete-unneeded-folders-t – sgriffin Jul 12 '18 at 15:51
  • For general OOM stuff, though, Slipstick can't be beat. – sgriffin Jul 12 '18 at 15:51
  • Perfect, i'll look into those. Thanks! – Yousuf Jul 12 '18 at 16:52