I figured that out. Here is the code:
'============================================
' Remove All Menus
'============================================
Dim commandBars As ObjectWrapper = thisApplication.ActiveWindow.CommandBars()
'Set the expected values for flags for the InvokeMember calls
Dim flags As BindingFlags = BindingFlags.GetProperty Or
BindingFlags.DeclaredOnly Or BindingFlags.Public Or BindingFlags.Instance Or
BindingFlags.InvokeMethod
'Set arguments for InvokeMember calls
'Name of the toolbar (commandbar) that this button will be found on
Dim args As Object() = New Object() {"Menu Bar"}
'Get required commandbar
Dim commandBarItem As Object = commandBars.InvokeByName("Item", flags, args,
Nothing)
commandBarItem.enabled = False
Dim args1 As Object() = New Object() {"Formatting"}
'Get required commandbar
Dim commandBarItem1 As Object = commandBars.InvokeByName("Item", flags,
args1, Nothing)
commandBarItem1.enabled = False
Dim args2 As Object() = New Object() {"Standard"}
'Get required commandbar
Dim commandBarItem2 As Object = commandBars.InvokeByName("Item", flags,
args2, Nothing)
commandBarItem2.enabled = False
'============================================
' End of Remove All Menus
'============================================
My next question is where do I set them back on. I tried _shutdown and
finalize but it doesn't like that. I'm pretty sure I have to do this because
it whacked all my design time menus also. I deleted the file C:\Documents and
Settings\MY_USERNAME\Application Data\Microsoft\InfoPath\infopath.tbs to get
them back but don't want my users to have to do this. Thanks!