I'm using C++.The same work I do as follows(You can see I do it with OOM): { HRESULT hr = S_FALSE; try{ CComPtr<Outlook::_Explorer> spExplorer ; hr = COOMFunc::ActiveExplorer((LPDISPATCH*)&spExplorer); if( S_OK != hr ) throw (hr);
//Then we need to have a pointer to the commandbars, that is the toolbars in the UI Office::_CommandBarsPtr spCmdBars = NULL; //CComPtr < Office::_CommandBars> spCmdBars = NULL; hr = spExplorer->get_CommandBars(&spCmdBars); if(FAILED(hr)) throw (hr);
Office::CommandBarPtr spCmdBar = NULL; CComVariant vWeb(_T("Web")); hr = spCmdBars->get_Item(vWeb,&spCmdBar); if( FAILED(hr)) throw (hr); if( NULL == spCmdBar ) throw (S_FALSE); Office::CommandBarControlsPtr spCmdBarCtrls = NULL; spCmdBarCtrls = spCmdBar->GetControls(); if( NULL == spCmdBarCtrls) throw (S_FALSE); Office::CommandBarControlPtr spCmdBarCtrl = NULL; CComVariant vAddr(_T("Address:")); spCmdBarCtrl = spCmdBarCtrls->GetItem(vAddr); if( NULL == spCmdBarCtrl) throw (S_FALSE); //spCmdBarCtrl->PutVisible(VARIANT_FALSE); spCmdBarCtrl->PutEnabled(VARIANT_TRUE);
// The really Address control is a combox,so... Office::_CommandBarComboBoxPtr spCmdComboxPtr = spCmdBarCtrl; BSTR bstr = strSearch.AllocSysString();// strSearch is an URL link _bstr_t bsDest; bsDest.Attach(bstr); spCmdComboxPtr->PutText(bsDest); bsDest.Detach(); ::SysFreeString(bstr);
spCmdBarCtrl->Execute();
//spCmdBarCtrl->PutVisible(vbVisible);
} catch(...) { ShellExecute(NULL, _T("open"), strSearch, 0, 0, 0); } } "RK" <RK[ at ]discussions.microsoft.com> дÈëÏûÏ¢ÐÂÎÅ:E85C3EF9-6E6B-47EC-A913-3F100E45570D[ at ]microsoft.com...
[Quoted Text] >I would like to launch a link to a web application > and browse this page from within (Embedded ) Outlook (using c#). > I dont want to use a folder structure and set the homepage . > > I got a link http://www.outlookcode.com/d/tips/formhyperlink.htm to do > this > . Is there any other related links to this . > > Thanks > RK >
|