Evaluating VBE's Code Line Counts

The VBE object model offers a great way to manipulate the Visual
Basic IDE and its components. With it, you can create add-ins
that automate many of the mundane tasks you face as a developer.
As you may know, in this object model each component in a
project-form, module, class, property page, etc. has an associated
CodeModule that contains the code behind the component. However,
when you use any of the CodeModule's code manipulation properties
or methods, keep in mind that this object includes all lines in
its counts, including procedure and event declarations as well
as carriage returns.

So, if a standard module contained:

Private Sub AnotherTestCode()
' Comments make the code
' more readable in every way.

End Sub

then the CodeModule.CountOfLines property would return 6-four
code lines, and two carriage returns.

You might also like...

Comments

ElementK Journals

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Owning a computer without programming is like having a kitchen and using only the microwave oven” - Charles Petzold