cancel
Showing results for 
Search instead for 
Did you mean: 

External References and Namespace Imports for Outlook automation with VBA

GustafLindquist
Level 2
I'm trying to use VBA to control Outlook, but I can't wrap my head around what External References and Namespace Imports to use to make the code work. Any suggestions on where to turn for detailed info on this? thanks
5 REPLIES 5

John__Carter
Staff
Staff
Hi Gustaf - if you have time to wait we'll be releasing an Outlook VBO soon, I don't know the exact date but it will probably come with v6.3. But in the meantime if you want to try your own the reference is something like C:\Program Files (x86)\Microsoft Office\root\Microsoft.Office.Interop.Outlook.dll and the Namespace is Microsoft.Office.Interop.Outlook

DmytroShpin
Level 3
Hello Gustaf - I agree with John that you have to use Microsoft.Office.Interop.Outlook. I personally had experience with that, I was trying to write some VB code blocks, however I wasn't really able to bypass Outlook object model security guard. You see, when using VBA for Outlook, each time I got a warning message that someone is trying to read\write in Outlook which is OK, but you have to manually confirm that it's me trying to execute the code. @John_Carter, I wonder whether Outlook VBO will solve the problem 

John__Carter
Staff
Staff
Hi Dmytro - I think the security pop up is a Windows issue related to Antivirus. This research might help https://social.technet.microsoft.com/Forums/ie/en-US/e2c89fec-beb3-4224-a6cb-112704406907/cannot-change-programmatic-access-security?forum=outlook

DmytroShpin
Level 3
John, thanks for the reply! I know, that might definitely help me out. But what if I'm not allowed to do that? In other words, I'm curious if the upcoming Outlook VBO will require additional setup of the software to make it works.

John__Carter
Staff
Staff
If your security policy will not allow programmatic access to Outlook, then I guess the VBO will not work for you.