This method adds a custom menu item to the HotDocs assembly window menus.
For example, you may want to display your own "About" dialog box from the HotDocs Help menu. You can use the AddUserMenuItem method to do this. When a user selects the item, the _AssemblyEvents.OnUserMenuItemClickedEvent event is fired to notify your application that your menu item was chosen.
This method only manipulates the menus in the assembly interface. To add items to the library interface, see Application.AddUserMenuItem or What is a HotDocs plug-in?.
void AddUserMenuItem ( string menuTxt, HotDocs.HDAIMENU menuItem, out int uiHandle )
Parameters | Description |
menuTxt | The text to be inserted into the menu. (You can use a single hyphen ( - ) to insert a separator bar into the menu.) |
menuItem | The name of the HotDocs menu to which the menu item will be added. This must be a member of the HDAIMENU enumeration. |
uiHandle | This is the menu handle that the program can use to track when someone clicks the menu entry. |
The following Visual C# example adds a separator and item to the Help menu:
public class ExampleCode { static void Main() { HotDocs.Application app = new HotDocs.Application(); HotDocs.Assembly asm = new HotDocs.Assembly(); int h_sep, h_addh; asm.TemplatePath = @"C:\Documents\HotDocs\Templates\demoempl.docx"; asm.AddUserMenuItem("-", HDAIMENU.AI_HELP, out h_sep); asm.AddUserMenuItem("Additional Help", HDAIMENU.AI_HELP, out h_addh); asm.Visible = true; app.Assemblies.Add(asm); } }