A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Add-ins for Outlook
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

How to remember toolbar position.



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old January 20th 06, 05:13 PM posted to microsoft.public.outlook.program_addins
Vinayakc
external usenet poster
 
Posts: 22
Default How to remember toolbar position.

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

Ads
  #2  
Old January 20th 06, 07:05 PM posted to microsoft.public.outlook.program_addins
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default How to remember toolbar position.

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" wrote in message
oups.com...
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



  #3  
Old January 23rd 06, 02:16 PM posted to microsoft.public.outlook.program_addins
Vinayakc
external usenet poster
 
Posts: 22
Default How to remember toolbar position.

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

  #4  
Old January 23rd 06, 06:35 PM posted to microsoft.public.outlook.program_addins
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default How to remember toolbar position.

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" wrote in message
ups.com...
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



  #5  
Old January 27th 06, 02:30 PM posted to microsoft.public.outlook.program_addins
Vinayakc
external usenet poster
 
Posts: 22
Default How to remember toolbar position.

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

  #6  
Old February 3rd 06, 09:02 AM posted to microsoft.public.outlook.program_addins
Vinayakc
external usenet poster
 
Posts: 22
Default How to remember toolbar position.

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

  #7  
Old February 3rd 06, 03:26 PM posted to microsoft.public.outlook.program_addins
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default How to remember toolbar position.

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" wrote in message
oups.com...
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


 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Tool bars change position Math Outlook - Installation 4 February 23rd 06 09:57 PM
Disable the toolbar Teelions Outlook - Using Forms 3 February 16th 06 10:46 PM
outllook pst folder position Philip Leduc Outlook - General Queries 1 February 3rd 06 10:00 AM
Outlook doesn't remember the calendar window size OMJ Outlook - Calandaring 2 February 1st 06 09:31 AM
Position of 'TODAY' Hildegarde Outlook - Calandaring 2 January 26th 06 05:23 PM


All times are GMT +1. The time now is 08:48 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.