Q:

Insert entry in WinEdt 8.1

How can I create a Insert menu entry for a new environment I created. For example, one can insert a figure by going to Insert > Objects > Figure. Of course, custom environments can be gotten by going to Insert > Environments > New Environment but I would like one that I can activate via a shortcut like CTRL+ALT+E or the like and even from the menu tab Insert. The result should look like the following:

A:

You can use this WinEdt macro, which inserts what you want on a new line in WinEdt:
BeginGroup;
InsLine;
NewLine;
Mark(1);
Ins("\begin{example}{}%");
InsLine;
Indent;
InsertBullet;
InsLine;
Ins("\begin{solution}%");
InsLine;
Indent;
InsertBullet;
InsLine;
Unindent;
Ins("\end{solution}%");
InsLine;
Unindent;
Ins("\end{example}");
Goto(1);
NextBullet;
EndGroup;

Save it as example.edt  in, say, %b\Local\Macros\. Then add to %b\ConfigEx\MainMenu.ini (you can edit it from the Options Interface), the following lines just between line 1332 (ITEM="-") and line 1333 (SUBMENU="Font>"):
  SUBMENU="Personal>"
      CAPTION="&Personal"
      CONFIG_FILTER="Default;MiKTeX;TeX Live;HTML"
      REQ_DOCUMENT=1
    ITEM="Example"
      CAPTION="&Example"
      MACRO="Exe('%b\Local\Macros\example.edt');"
      REQ_DOCUMENT=1
  END="Personal>"
  ITEM="-"      

Final step: save the new MainMenu.ini on clicking on the  leftmost icon in the Options Interface, so that the modifications be written in WinEdt.dnt. You'll then have access to the macro example.edt either from the Insert -> Personal submenu, or with the Alt+I+P+E shortcut.
Let me know if it doesn't work fine: it might depend on personal configurations, though I don't think so.

