Outlook Banter

Outlook Banter (http://www.outlookbanter.com/)
-   Outlook and VBA (http://www.outlookbanter.com/outlook-vba/)
-   -   Counting the total number of macros in an Office document (http://www.outlookbanter.com/outlook-vba/89615-counting-total-number-macros-office.html)

Rick Barnsley April 28th 09 10:18 AM

Counting the total number of macros in an Office document
 
Hi,

I'm trying to programmatically count the number of macros within an Office
document.

I haven't had much luck with finding a solution online.

I have tried accessing the VBAProjects through:

Application.VBE.VBProjects(1).VBComponents.Count

only to receive the error:

---------------------------
Microsoft Visual Basic
---------------------------
Run-time error '1004':

Programmatic access to Visual Basic Project is not trusted

---------------------------
OK Help
---------------------------

Is there another function I can call to return the number of available
macros for a given document?

Cheers,
Rick


All times are GMT +1. The time now is 05:06 PM.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2006 OutlookBanter.com