In a macro, I need to either use ActiveDocument (Word), ActiveWorkbook (Excel) or ActivePresentation (PowerPoint), but first I need to determine which application is running.
How can I find out which type of Office document a macro is running on?
This is a way to get the name of whatever application is running: