Hi Dmitry,
Thanks!
I have tried the solution which you gave me in your previous reply.
I am using following code to set the toolbar position:
SetToolBarPostion()
{
HRESULT hr = S_OK;
BOOL bRet = TRUE;
LONG lPosition;
Office::MsoBarPosition ePos;
INT iRowIndex;
INT iLeftPos;
INT iTopPos;
try
{
bRet = m_RegHelper.GetNumericValuesFromRegistry( &lPosition, POSITION
, DEFAULT_POSITION_FOR_FTUE);
ePos = (Office::MsoBarPosition)lPosition;
hr = m_pCommandBar->put_Position(ePos);
if( ePos != Office::msoBarFloating )
{
bRet = m_RegHelper.GetNumericValuesFromRegistry((LONG*) &iRowIndex,
ROW_INDEX , DEFAULT_POSITION_FOR_FTUE);
if( iRowIndex != DEFAULT_POSITION_FOR_FTUE )
{
hr =
m_pCommandBar->put_RowIndex((Office::MsoBarPosition)iRowIndex);
}
}
bRet = m_RegHelper.GetNumericValuesFromRegistry((LONG*) &iLeftPos,
LEFT_POS , DEFAULT_POSITION_FOR_FTUE);
if( iLeftPos != DEFAULT_POSITION_FOR_FTUE )
{
hr = m_pCommandBar->put_Left((Office::MsoBarPosition)iLeftPos);
}
if(ePos != Office::msoBarTop || ePos != Office::msoBarBottom)
{
bRet = m_RegHelper.GetNumericValuesFromRegistry((LONG*) &iTopPos,
TOP_POS , DEFAULT_POSITION_FOR_FTUE);
if( iTopPos != DEFAULT_POSITION_FOR_FTUE)
{
hr = m_pCommandBar->put_Top((Office::MsoBarPosition)iTopPos);
}
}
}
This code works fine.
But Outlook does not remember the position of that when I placed it
above menu bar.
I don't know why it is happening because I am setting it's row index as
well as left postion when it is in the Docking mode.
Thanks
Vinayakc