I've attached some VBA code to demonstrate this. The code adds the 'Rotate'
command to the context menu just before the 'Previous View' command. The
Rotate command is not added if the 'Previous View' command is not found in
the context menu.
Sanjay-
Put this code in a VBA module (say, Module1):
-------------------------------------------------
Option Explicit
Public oClass1 As Class1
Sub AddToContextMenu()
Set oClass1 = New Class1
oClass1.Initialize
End Sub
-------------------------------------------------
Put this code in a class module (called Class1):
-----------------------------------------------
Option Explicit
Private WithEvents oUserInputEvents As UserInputEvents
Public Sub Initialize()
Set oUserInputEvents = ThisApplication.CommandManager.UserInputEvents
End Sub
Private Sub oUserInputEvents_OnContextMenu(ByVal SelectionDevice As
SelectionDeviceEnum, ByVal AdditionalInfo As NameValueMap, ByVal CommandBar
As CommandBar)
Dim oControl As CommandBarControl
Dim oPreviousViewControl As CommandBarControl
Set oPreviousViewControl = Nothing
For Each oControl In CommandBar.Controls
If Not oControl.ControlDefinition Is Nothing Then
If oControl.ControlDefinition.InternalName =
"AppPreviousViewCmd" Then
Set oPreviousViewControl = oControl
Exit For
End If
End If
Next
If Not oPreviousViewControl Is Nothing Then
Dim oRotateCmd As ControlDefinition
Set oRotateCmd =
ThisApplication.CommandManager.ControlDefinitions.Item("AppRotateViewCmd")
Dim oRotateControl As CommandBarControl
Set oRotateControl = CommandBar.Controls.AddButton(oRotateCmd,
oPreviousViewControl.index)
oRotateControl.GroupBegins = True
oPreviousViewControl.GroupBegins = False
End If
End Sub
-----------------------------------------------
And run the function AddToContextMenu. You should now see the Rotate command
in the context menu.
"Tom" wrote in message
news:41c1b550$1_2@newsprd01...
> Is there a way to add 3d orbit to the right click menu?
>
> Thanks,
> Tom
>
>