Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Outlook VBA - Trust access

Andrzejek

Programmer
Jan 10, 2006
8,486
5
38
US
To get the values in Excel with this line:

[tt]Application.VBE.ActiveVBProject.VBComponents.Count[/tt]

I needed to go to: File - Options - Trust Center - Trust Center Settings - Macro Settings
and check Trust access to the VBA project object model

What do I need to do / set in Outlook to be able to run the same line:
[tt]Application.VBE.ActiveVBProject.VBComponents.Count[/tt]
[ponder]

---- Andy

"Hmm...they have the internet on computers now"--Homer Simpson
 
Good luck with that. Microsoft removed access to the VBEIDE library in Outlook years ago. Considered too much of a security risk (higher security risk than in other Office applications)
 
Try this
Sub OpenTrustCenter()
Dim MSec As Integer, OApp As Object
Set OApp = CreateObject("Outlook.Application")
MSec = OApp.Application.explorers.Item(1).CommandBars.ExecuteMso("MacroSecurity")' This will open the trustcenter for the user to change the current setting.
End Sub
 
MSec = OApp.Application.CommandBars.ExecuteMso("MacroSecurity") ' Perhaps this i the line in access 2016
 

Part and Inventory Search

Sponsor

Back
Top