How to parse VBA script file in MFC ?
How to parse VBA script file in MFC ?
I want the following information from the VBA macro file,
1. Number of modules in the script.
2. Name of all the modules.
3. All the function names in the given modules.
Is there any scripting engine ?
Any help would be appreciated.
Thanks and Regards,
Paresh.
# 1 Re: How to parse VBA script file in MFC ?
There are different kinds of VBA: VBA for Excel, Access, Word, Outlook, ... They are not all the same. Which one are you trying to use?
I have searched a few pieces of information about Outlook VBA modules myself, because I was asked to write a script that would automatically insert a few VBA modules for the staff of our company, so that statistics could be done on mails. Unfortunately I found nothing, and it is said that Microsoft has taken a special care to hide the VBA codes in Outlook for security reasons. I understand that policy because VBA modules, inserted by a virus, could do unpleasant things, even thought that's a pity for some harmless applications.
If you can export the VBA modules, for instance via a copy/paste to a word editor, then counting the number of functions should be quite easy. have a loop for each line and look for the "sub" and "proc" keywords.