Group:  Microsoft Outlook ยป microsoft.public.outlook.program_addins
Thread: How to remember toolbar position.

Geek News

How to remember toolbar position.
"Vinayakc" <vinayakchitre[ at ]gmail.com> 1/20/2006 4:13:12 PM
Hi all,

Can anyone please tell me how we can remember add-in toolbar position
which user set in previous session of Outlook.
OutlookSpy remembers it.

Thanks and Regards
Vinayakc

Re: How to remember toolbar position.
"Dmitry Streblechenko" <dmitry[ at ]dimastr.com> 1/20/2006 6:05:17 PM
Save the CommandBar.Position property when the window is about to be closed
and set it when creating the toolbar next time.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"Vinayakc" <vinayakchitre[ at ]gmail.com> wrote in message
news:1137773592.954073.309840[ at ]o13g2000cwo.googlegroups.com...
[Quoted Text]
> Hi all,
>
> Can anyone please tell me how we can remember add-in toolbar position
> which user set in previous session of Outlook.
> OutlookSpy remembers it.
>
> Thanks and Regards
> Vinayakc
>


Re: How to remember toolbar position.
"Vinayakc" <vinayakchitre[ at ]gmail.com> 1/23/2006 1:16:53 PM
Hi Dmitry,
Thanks for your help.
Dmitry I heard that OL2003 remembers toolbar positions itself.
Is there any other way aprt from storing the positions in regisrty or
..ini file.
Can we specify any property for CommandBar while adding it to toolbar.

Thanks and Regards
Vinayakc

Re: How to remember toolbar position.
"Dmitry Streblechenko" <dmitry[ at ]dimastr.com> 1/23/2006 5:35:20 PM
Outlook will remember the toolbar position if you create the toolbar as
non-temporary when calling CommandBars.Add.
The downside however is that if your app is uninstalled, Outlook will
recreate a (now non-functional) toolbar when it starts.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"Vinayakc" <vinayakchitre[ at ]gmail.com> wrote in message
news:1138022213.435841.12340[ at ]g14g2000cwa.googlegroups.com...
[Quoted Text]
> Hi Dmitry,
> Thanks for your help.
> Dmitry I heard that OL2003 remembers toolbar positions itself.
> Is there any other way aprt from storing the positions in regisrty or
> .ini file.
> Can we specify any property for CommandBar while adding it to toolbar.
>
> Thanks and Regards
> Vinayakc
>


Re: How to remember toolbar position.
"Vinayakc" <vinayakchitre[ at ]gmail.com> 1/27/2006 1:30:26 PM
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

Re: How to remember toolbar position.
"Vinayakc" <vinayakchitre[ at ]gmail.com> 2/3/2006 8:02:55 AM
Hi Dmitry,

I have just tried permanent toolbar also.
you are right, when my application gets uninstall plug-in will not get
removed from toolbar.
What is the solution for this?
I am using installshield for installation/uninstallation of add-in?

Thanks and Regards
vinayakc

Re: How to remember toolbar position.
"Ken Slovak - [MVP - Outlook]" <kenslovak[ at ]mvps.org> 2/3/2006 2:26:50 PM
Always create a toolbar using the Temporary := True setting. The alternative
is to run a script in InstallShield on removing the installation that would
start Outlook with a UI and delete the toolbar. That's ugly.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"Vinayakc" <vinayakchitre[ at ]gmail.com> wrote in message
news:1138953775.359469.273930[ at ]g44g2000cwa.googlegroups.com...
[Quoted Text]
> Hi Dmitry,
>
> I have just tried permanent toolbar also.
> you are right, when my application gets uninstall plug-in will not get
> removed from toolbar.
> What is the solution for this?
> I am using installshield for installation/uninstallation of add-in?
>
> Thanks and Regards
> vinayakc
>

Home | Search | Terms | Imprint Contact
Newsgroups Reader - provided by WiredBox.Net