Finding menu item ID
I'm almost new user of Drupal, but I encountered the same problem because I write myself my modules.
My need is to create a node and to insert it as submenu of a main menu Item. I solved my problem in this way:

I wrote this function

function mymodule_get_plid($menu_name , $name) {
    $menu = menu_tree_all_data($menu_name);
    foreach ($menu as $item =&gt; $menuitem) {
        if ($name == $menuitem['link']['link_title']) {
            return $menuitem['link']['mlid'];
            break;  
        }
    }
    return false;
}


where $menuname is a string like 'main-menu', $name is the menu item for which I'm searching for it's Id. Function return Id if it find $name, false otherwise.

Now to complete node creation i wrote this.

$node = new stdClass();
$node-&gt;title = "YOUR TITLE";
$node-&gt;type = "page";  // Creating a node of Basic page type
node_object_prepare($node); // Sets some defaults. Invokes hook_prepare() and hook_node_prepare().
$node-&gt;language = LANGUAGE_NONE; // Or e.g. 'en' if locale is enabled
$node-&gt;uid = $account-&gt;uid;
$node-&gt;status = 1; //(1 or 0): published or not
$node-&gt;promote = 0; //(1 or 0): promoted to front page
$node-&gt;comment = 0; // 0 = comments disabled, 1 = read only, 2 = read/write

$node-&gt;menu['enabled'] = TRUE;
$node-&gt;menu['menu_name'] = 'main-menu';
$node-&gt;menu['plid'] = mymodule_get_plid('main-menu' , 'Inquiries');
$node-&gt;menu['link_title'] = 'MY SUBMENU NAME';
$node-&gt;menu['description'] = ''; // Needed even if empty to avoid notices.  /*  

$node = node_submit($node); // Prepare node for saving
node_save($node);


Now all behaves well, "MY SUBMENU NAME" is created as a new node and appended as sub menuitem of the 'Inquiries' menu Item of the main menu.