How can I get calendar selection to form (VBA)?



I am trying to create an holiday planner, which relies on the
appointment technique. So far I created a button to open the
appointment form with some pre-defined parameters.
But now I have the problem to get the information of the selection in
the calendar. For example: marked from 9.30 to 15.30. Then press the
button to open the form. But how can I get the information of the
selection into the form?

Another question: how can I add "new holiday" to the right-click-menu
on the calendar. the menu bars are no problem, but the context menu

Thanks for any help in advance.

Rgds, usabmaster

Sue Mosher [MVP-Outlook]

The trick is to use CommandBars to execute the New command. See for a code sample.

In versions before Outlook 2007, Outlook does not directly expose the right-click context menu in its CommandBars collection. You will, however, see a new right-click command is when the item selected is using a custom form that includes one or more custom actions. You can also add a custom action without using a custom form, as demonstrated at

Richard Kagerer has posted a code sample at that shows how you might trick Outlook into exposing the context menu through Explorer.CommandBars.

Outlook 2007 provides Application-level events for the most commonly used context menus.

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question