Ascertaining whether a search in VBA code returns a string or areserved word
Can you look for it at the beginning of the line--after you trim any leading
spaces (and ignoring Public/Private key words)?
And I think you'd have to make sure a space character followed it.
And you may have to count quotes to see if you're in a string.
Dim myStr as string
mystr = "Do you have anything to" & _
" declare"
Paul Martin wrote:
Hi all
I am writing some code that searches a VBA project for (in this case)
APIs and I am using "Declare" as the search criteria. If I find
"Declare", is there some way (perhaps an API) that can ascertain
whether the use of "Declare" is a string or a reserved word?
Now, I realise that if it is an API, it would be followed by "Function"
or "Sub". I have other search criteria that I also need to look for
(such as "Shell" and ".RegisterDatabase").
Any suggestions appreciated. Thanks in advance.
Paul Martin
Melbourne, Australia
--
Dave Peterson
|