VBE_Extras catch-up #4: Info for code at cursor
- John
- 19 hours ago
- 2 min read
When I first made VBE_Extras available for download, it contained a whole load of functionality that I never wrote blog posts about. I'm now setting that right for a few of the core areas of that functionality.
The 'Info for code at cursor' command of VBE_Extras is context-sensitive ... the result it produces depends on where your cursor is.
If the cursor is on a the name of a declaration (eg the name of a variable following Dim or the name of a procedure following Sub or Function ... for more on declarations, see VBE_Extras catch-up #2: Listing all declarations) then it will show you information about that declaration. However, as the cursor is already "on" it then you can already see that information on-screen.
If the cursor is on a reference of a declaration (e.g. something that has been declared elsewhere) then, again, it will show you information about that declaration. This can be useful if the declaration is off-screen (eg it could be declared within the same procedure but you have scrolled down so the declaration cannot be seen; or maybe the declaration is at the Module-level; or maybe the declaration is in another Module entirely).
However, when 'Info for code at cursor' gets more interesting is when your cursor is on something that is not a declaration in your Project. For example, if the cursor is on the Long keyword, you get this dialog ...

... and if you then click on the MS Docs button, this web page is opened ...

If the cursor is on an Object-type, for example (in Excel) the Worksheet, you get this dialog ...

... and if you then click on the MS Docs button, this web page is opened ...

If the cursor is on a member of an Object-type, for example the Count property of the Collection object, you get this dialog ...

... and if you then click on the MS Docs button, this web page is opened ...

And another example where the cursor on on the CreateTextFile member of the FileSystemObject, you get this dialog ...

... and if you then click on the MS Docs button, this web page is opened ...

'Info for code at cursor' also works when using Special binding. However, note that opening the relevant documentation web pages only works for a specific set of libraries and depends on a number of factors, discussed more in the Opening Microsoft documentation web pages using VBE_Extras post.



Comments