Useful Outlook VBA examples Create an email message
How to setup the developer tab in Outlook?
Never copy VBA code from unknown resources. Note: Read on for some simple code examples to get you started with VBA. This will bring you back to your Outlook user interface. Go ahead and close the Developer environment.Paste your VBA code into the Module window.To accomplish that, go ahead and select Module. You’ll now going to inset a Visual Basic module.Right click ThisOutlookSession and then hit Insert.Expand the project tree until the ThisOutlookSession node.The VBA developer Integrated Development Environment (IDE) will be opened.Now, go ahead and hit the Alt button + F11.Note: If you are interested to know how the Office macro recorder actually works, i would recommend to look into the MS Word Macros and Excel VBA Macro tutorials. Therefore, if we want to add our own custom functionality to Outlook, we’ll need to learn to write simple VBA programs and incorporate them into our Outlook session. Unlike other Office apps, Outlook does not offer a simple Macro recorder to capture user actions and auto-generate the required VBA code for us in the background. And we’ll finish by enabling Outlook macros and handling their security settings to ensure that the code will actually run when prompted in our computers.This will allow the us to run the macro with ease. Next, we’ll go ahead and define a shortcut icon for our macro in the Quick Access Toolbar.This will help you to grasp the Macro development basics and allow you to write simple macros. We’ll go through the most basic examples of Outlook VBA.We’ll then set up the macro development environment in our computer.
On my PC 5 seconds is overkill, but you never know. This allows time for Outlook to load if it wasn't running. Delay X seconds, where X is the number set to the variable in step 1.Type in CTRL+SHIFT+B - This is the hotkey to open the Global Address List in Outlook.If the program OUTLOOK.EXE is running, activate that window, otherwise launch it.If a window title containing " - Outlook" isn't running, set a variable to 5.But I wanted to leave just the GAL window showing, so I did a little extra on mine: Basically you just need to launch Outlook if it isn't running, then hit Ctrl+Shift+B. Personally I use MacroExpress, put I'm sure AutoHotKey could do it too. The only way I've found to accomplish this is to use a macro program.
So essentially, this is a fully MANUAL process now. We used to be able to at least specify a VBA macro to run from the command line, but that's no longer possible. Apparently Outlook MUST be running to access the GAL, and there's no way to activate the GAL through scripting.