Macros, Macros, Macros: What the heck is a Macro in MS Office products like Word, Excel, PowerPoint and others?
Now that I wrote a post about moving Macros from Word 2003 or Office XP, the conversation has changed to just what is a Macro in these products?
In Office there is code behind, just like in Windows Presentation Foundation or Silverlight. In the case of Office, it is VBA or if you wish C#. This is a special kind of language that you use to manipulate the Office app. And it isn’t new, this has been part of Office for as long as I remember.
When you record a keystroke macro you are writing a program, a very simple program, the program can’t make any decisions, unless you edit the Macro. From a skilled programmer point of view these kinds of programs are usually used to remind them of things or to help them understand what the end user is doing. If you are create keyboard macros for work use, then you likely have had the time to explore the underlying language. Unfortunate, as you can make money by improving Office Apps and customizing them.
For instance, let’s say you are in a legal office and you are a paralegal. You create a whole bunch of macros for your work, things like modifying signature blocks. Now for me, that would be something I couldn’t even phantom as to why that is necessary, but sometimes you have to do that in law. As a programmer, I would take a step back, whine to my manager that this is boring and I need time to “generalize” the effort so that it is “reusable”. As a software manager, I would just want the programmer to go away so I would give him permission to do his thing. As a paralegal, you would likely not get away with that working for a lawyer, efficiency is the game here.
Sooo, you create a keyboard macro, quick easy to do, and if you are doing a large number of documents, quicker than typing everything in one by one.
Your boss has ask that you change the signature block on hundreds of documents (I have no idea if this is an actual scenario, but let’s go with it):
Open one of the documents, and then using the Ribbon:
- View – Macro – Record Macro
- Enter a name for the macro with no spaces in the name
- Assign the macro to
- A button that will appear on the quick access bar (not the ribbon)
- keyboard keystroke (which I recommend)
In your document
- Select the line to change in the open document
- Make the change
- View – Macro – Stop Recording
- Make sure to save to Normal.Dotx (not the current document, which is ok, but it will only work in that document)
The process is similar for PowerPoint, Excel, MS Project, Publisher, Access, Visio, not quite the same, each has slight differences.
Now that you have written the Macro, what does the Word App use? Does it memorize the keystrokes? Or does it use that mysterious language of programmers (not only are they weird in reality, they also have to write in syntax free language when they do their jobs, and you thought lawyers had language difficulties):
Sub ChangeName( )
'
' ChangeName Macro
'
'
Selection.TypeText Text:="Ba Ba Helen"
End Sub
That’s it! Think about: If you can work with legal stuff all day long, you could become a software specialist!
Really, I think that paralegals have the chops and the discipline to be good software technologist, architects, etc. Excellent software types have to have the really cranking hard math under their belts, which is not to say paralegals shouldn’t do it, but if you are a paralegal who is thinking about changing jobs, aren’t you wanting to get somewhere else in your career quickly?
So just take the classes, pick up programming as a hobby building games for the Windows Phone, don’t worry about calculus or discrete math, just learn how to do the fun stuff. Let the CS departments torture the young ones with that kind of stuff. Don’t worry about the grade you get in class, the important thing is to LEARN and have FUN!
Consider taking a class on software design at the community college, you can skip all of the calculus and other math stuff, after all you have “domain” knowledge about the law and that is what matters, BIG time!