Parshu & Ken -- Well you really sent us down a "rabbit-hole" with this one. After quite a bit of fussing around, I was able to duplicate the problem as both of you described. I also discovered, as Parshu described, that closing and reopening a Note seems to get the dropdown working as we would like. Ken has confirmed this with some experimentation on his machine.
Looking at it now, it is not surprising that there is some shaky behavior. When using this combination of shortcut keys, we are asking Outlook to act differently (in the case of a Note) than it, and Windows in general, acts in all other cases. With any other kind of Item inspector, "Alt + Spacebar" brings up that window's system menu. With the Note, we are asking it to bring up a contextual dropdown menu instead, but obviously it wants to bring up the system menu sometimes.
In any case, with the info gathered from everyone's experimentation, I've put together a little workaround. With the code listed below, you can create a new toolbar button, with the shortcut keys "Alt + o", that does the following:
- If a Note Item is currently open or just selected in a Table view, then the code opens the Note and sends the necessary keystrokes to get the "Alt + Spacebar" keys working properly;
- If some other kind of Item is currently selected, then using the button (or "Alt + o") creates a new Note and performs the keystrokes to correct the "Alt + Spacebar" problem.
So instead of double clicking a Note to open it, or using "Ctrl + Shift + N" to create a new Note, using "Alt + o" will do the same and make the dropdown workable.
To try the workaround, just copy and paste the code below into a new module in your VBA Editor. Run the NewNotesButton macro
once to install the new button on your Standard toolbar. The button will then be functional.
Hope that helps. And thanks for pointing out this little problem -- consequently I've incorporated a little fix in the upcoming
Outlook Outliner. Here's the code (as always, let me know if you need any help getting the code going):
Code:
Sub NoteMenu()
On Error GoTo PROC_ERR
Dim objApp As Application
Dim objItem As Object
Dim objNote As NoteItem
Set objApp = CreateObject("Outlook.Application")
Set objItem = GetCurrentItem
If Not objItem Is Nothing Then
If objItem.Class = olNote Then
objItem.Display
SendKeys "%{F4}~", True
Else
Set objNote = objApp.CreateItem(olNoteItem)
objNote.Display
SendKeys "%{F4}", True
objNote.Display
End If
End If
Set objNote = Nothing
Set objItem = Nothing
Set objApp = Nothing
PROC_EXIT:
Exit Sub
PROC_ERR:
MsgBox Err.Description
Resume PROC_EXIT
End Sub
Function GetCurrentItem() As Object
Dim objApp As Application
Dim objSel As Selection
Dim objItem As Object
Set objApp = CreateObject("Outlook.Application")
Select Case objApp.ActiveWindow.Class
Case olExplorer
Set objSel = objApp.ActiveExplorer.Selection
If objSel.Count > 0 Then
Set objItem = objSel.Item(1)
End If
Case olInspector
Set objItem = objApp.ActiveInspector.CurrentItem
Case Else
End Select
Set GetCurrentItem = objItem
Set objItem = Nothing
Set objSel = Nothing
Set objApp = Nothing
End Function
Public Sub NewNotesButton()
Dim objCommandBar As Office.CommandBar
Dim objCommandBarButton As Office.CommandBarButton
Set objCommandBar = Application.ActiveExplorer.CommandBars("Standard")
With objCommandBar.Controls
Set objCommandBarButton = .Add(msoControlButton)
With objCommandBarButton
.Caption = "&Open"
.FaceId = 1758
.Style = msoButtonIconAndCaption
.TooltipText = "Click to Open Note"
.OnAction = "NoteMenu"
.BeginGroup = True
End With
End With
End Sub