Introducing Napa – A Web Based IDE for Outlook/SharePoint
VBA, the macro language for Office, is essentially at a dead end. Based on COM version of Visual Basic, it is stuck with a technology that hasn’t had a meaningful update in over a decade. Visual Studio Tools for Office exists, but isn’t available to non-professionals and can be difficult to use due to the mismatch between COM and .NET technology. And then there SharePoint, which has never had a good story for casual developers. Toss in the need for macros in the hosted version of Office and SharePoint and you end up with quite a mess.
This is where Project Napa enters the seen. Somasegar introduces Napa as,
To create a button one of course needs a function to receive the click event. This is pretty much the same in any language, the difference is in how you wire it up. In VB (COM or .NET) the function is attached to the button declaratively. In C# one uses the event handler syntax, which takes a single line of code.
In the example offered by Somasegar, you need to assign an anonymous function to Office.initialize. This anonymous function calls $(document).ready, passing in a second anonymous function. Inside that function is a third anonymous function that attached to the button’s click event using another jQuery operation. This kind of function nesting may be acceptable to skilled web developers, but is not appropriate for someone trying to create a simple macro in Excel.
Anatole Tresch Mar 03, 2015