Tuesday, November 25, 2008

How to add custom menus in InfoPath form

Add the following code in manifest.xsf

<xsf:menuarea name="msoStructuralEditingContextMenu">
<xsf:button name="TestMenu" caption="Test Menu" xmltoedit="field1" showif="immediate">lt;/xsf:button>
</xsf:menuArea>

A new custom menu "Test Menu" will be added. xmltoedit specifies the field for which this menu must appear.

In FormCode.vb, add the event handler for the menu as follows:
< infopatheventhandler(matchpath:="testmenu",> _
Public Sub TestMenu_OnClick(ByVal e As DocActionEvent)

No comments: