OK... let's assume you have processed and caught the selected item in the tree. First get a pointer to the main frame window:
CWnd* pMainFrameWnd = ::AfxGetMainWnd();
Then, pass that pointer into the :

ostMessage() function to pass a message onto your main frame code:
:

ostMessage(pMainFrameWnd,WM_USER,NULL,NULL);
Now, use class wizard to add a PreTranslateMessage() function handler for your CMainFrame code:
BOOL CMainFrame:

reTranslateMessage(MSG* pMsg)
{
// TODO: Add your specialized code here and/or call the base class
// ok, let's catch the message we sent
if (pMsg->message == WM_USER)
{
// do something here
}
return CMDIFrameWnd:

reTranslateMessage(pMsg);
}
You can further expand on this messaging by using the wParam and lParam parts of the message. For example, you could give the wParam/lParam parts specific numeric codes which define different actions to take when the message is intercepted in your main frame code.
#define kDoThis 1234
#define kDoThat 1235
:

ostMessage(pMainFrameWnd,WM_USER,kDoThis,NULL);
Then, in your main frame code, you can do this or that depending on the value of the wParam part of the message:
BOOL CMainFrame:

reTranslateMessage(MSG* pMsg)
{
// TODO: Add your specialized code here and/or call the base class
// ok, let's catch the message we sent
if (pMsg->message == WM_USER && pMsg->wParam == kDoThis)
{
// do this
}
else if (pMsg->message == WM_USER && pMsg->wParam == kDoThat)
{
// do that
}
return CMDIFrameWnd:

reTranslateMessage(pMsg);
}
Hope this helps to explain things a bit better.
You will find it easier to do what you want to do if you're passing the message to the main frame code first because the main frame contains all the documents you have open. So, if you want an open document to open another new document, post a message to main frame with a specific code:
#define kOpenNewDoc 12345
:

ostMessage(pMainFrameWnd,WM_USER,kOpenNewDoc,NULL);
In your main frame code, catch the message and then open a new document:
BOOL CMainFrame:

reTranslateMessage(MSG* pMsg)
{
// TODO: Add your specialized code here and/or call the base class
// ok, let's catch the message we sent
if (pMsg->message == WM_USER && pMsg->wParam == kOpenNewDoc)
{
// open a new document
}
return CMDIFrameWnd:

reTranslateMessage(pMsg);
}
