Toolbar is missing from outlook 2003.2007

Add-in Express™ Support Service
That's what is more important than anything else

Toolbar is missing from outlook 2003.2007
Toolbar is missing from outlook 2003/2007 
Sridhar Kapavarapu




Posts: 59
Joined: 2009-07-29
Hi,

we have a button and text box in outlook toolbar. Based on the visible status(Enable/Disable) from registry, toolbar will be Enabled/Disabled in outlook.

#1. Toolbarstatus is true in registry and When we open outlook this registry value becomes false. i.e., ExplorerCommandbar.visible property always returns false.

#2. Whenever we sel ect different folder, we handled BeforeFolderswitchevent. In this case also ExplorerCommandBar.visible property returns false. So, whenever we slected different folder, toolbar is gone fr om the outlook and false is set to registry value.

This behavior is only with latest adxloader version 6.0.3043/6.0.3038.

Worked fine with adxloader version 5.1.2022.
Posted 05 Aug, 2010 02:06:53 Top
Eugene Astafiev


Add-in Express team


Posts: 8540
Joined: 2007-07-25
Hi Sridhar,

Could you please send a sample add-in project to me? I will test it on my PC. Please use the support e-mail address (see readme.txt).
.NET, Extended MAPI, Windows Phone & RT
Posted 05 Aug, 2010 03:38:24 Top
Sridhar Kapavarapu




Posts: 59
Joined: 2009-07-29
Hi Eugene,
You can try this with sample application provided by add-in.

http://www.add-in-express.com/files/projects_pub/as/MyAddin120.zip

Regards
Sridhar K
Posted 05 Aug, 2010 07:22:07 Top
Sridhar Kapavarapu




Posts: 59
Joined: 2009-07-29
Hi,

R u able to reproduce this behavior? Please update.

Regards
Sridhar K.
Posted 06 Aug, 2010 08:28:20 Top
Andrei Smolin


Add-in Express team


Posts: 17306
Joined: 2006-05-11
Hi Sridhar,

Sridhar Kapavarapu wrote:
#1. Toolbarstatus is true in registry and When we open outlook this registry value becomes false.


I download the project, register it, run Outlook, close it, open regedit.exe, set CommandBarVisible = 1 in HKCU\Software\Microsoft\Office\Outlook\Addins\MyAddin120.AddinModule\My, run Outlook and see the toolbar visible and the registry value non-changed. This is the expected behavior because the code changes that value in AddinModule_AddinBeginShutdown.

Sridhar Kapavarapu wrote:
#2. Whenever we sel ect different folder, we handled BeforeFolderswitchevent. In this case also ExplorerCommandBar.visible property returns false.


There's no such event in MyAddin120 project. Are we talking about the same project?

Regards from Belarus (GMT+2),

Andrei Smolin
Add-in Express Team Leader
Posted 06 Aug, 2010 09:48:30 Top
Sridhar Kapavarapu




Posts: 59
Joined: 2009-07-29
Hi Andrei,

Whenever i moved the focus to other folder BeforeFolderswitchevent gets fired. explorercommandbar.visible property is true now. Then following code gets executed.

public override System.ComponentModel.IContainer GetContainer()
{
if (components == null)
components = new System.ComponentModel.Container();
return components;
}

When i expand the components i am able to see the explorercommandbar properties including visible property. Visible is true now also.

Now ADXOlFormsManager.FolderSwitch_EventHandler gets fired. i just printed a log statement there in that method.

Above Add-in Express automatic code get executed.
Now if i expand components i observed that explorercommandbar.visible property becomes false.

please suggest me if i am doing any thing wrong. Here is my code:

private void FindFolderType(string FolderType)
{
switch (FolderType)
{
case "IPM.Appointment":
this.adxOlExplorerCommandBarCore.ItemTypes =
AddinExpress.MSO.ADXOlExplorerItemTypes.olAppointmentItem;
break;

case "IPM.Contact":
this.adxOlExplorerCommandBarCore.ItemTypes = AddinExpress.MSO.ADXOlExplorerItemTypes.olContactItem;
break;

case "IPM.Activity":
this.adxOlExplorerCommandBarCore.ItemTypes = AddinExpress.MSO.ADXOlExplorerItemTypes.olJournalItem;
break;

case "IPM.StickyNote":
this.adxOlExplorerCommandBarCore.ItemTypes = AddinExpress.MSO.ADXOlExplorerItemTypes.olNoteItem;
break;

case "IPM.Post":
this.adxOlExplorerCommandBarCore.ItemTypes = AddinExpress.MSO.ADXOlExplorerItemTypes.olPostItem;
break;

case "IPM.Task":
this.adxOlExplorerCommandBarCore.ItemTypes = AddinExpress.MSO.ADXOlExplorerItemTypes.olTaskItem;
break;

case "IPM.Note":
this.adxOlExplorerCommandBarCore.ItemTypes = AddinExpress.MSO.ADXOlExplorerItemTypes.olMailItem;
break;

default:
this.adxOlExplorerCommandBarCore.ItemTypes = AddinExpress.MSO.ADXOlExplorerItemTypes.olUnknownItem;
break;
}

}

private void isToolbarVisible(bool _lastVisible)
{
if (_lastVisible == false)
{
this.adxOlExplorerCommandBarCore.Enabled = true;
this.adxOlExplorerCommandBarCore.Visible = false;
this.adxOlExplorerCommandBarCore.FolderName = "$@*";
}
else
{
this.adxOlExplorerCommandBarCore.Enabled = true;
this.adxOlExplorerCommandBarCore.Visible = true;
this.adxOlExplorerCommandBarCore.FolderName = "";
}
}

Regards
Sridhar K
Posted 09 Aug, 2010 08:41:51 Top
Andrei Smolin


Add-in Express team


Posts: 17306
Joined: 2006-05-11
Hi Sridhar,

May I ask you to send me your code to the support e-mail address, see {Add-in Express}\readme.txt? Please make sure your e-mail contains a link to this topic.

Regards from Belarus (GMT+2),

Andrei Smolin
Add-in Express Team Leader
Posted 09 Aug, 2010 10:05:15 Top
Sridhar Kapavarapu




Posts: 59
Joined: 2009-07-29
Hi Andrei,

I just sent the sample project.
Posted 10 Aug, 2010 02:24:22 Top
Andrei Smolin


Add-in Express team


Posts: 17306
Joined: 2006-05-11
Hi Sridhar,

Pay attention to my version of isToolbarVisible.

private void isToolbarVisible(bool _lastVisible)
{
    if (_lastVisible == false)
    {
        this.adxOlExplorerCommandBarCore.Enabled = true;
        this.adxOlExplorerCommandBarCore.Visible = false;
        this.adxOlExplorerCommandBarCore.FolderName = "$@*";
    }
    else
    {
        this.adxOlExplorerCommandBarCore.Enabled = true;
        this.adxOlExplorerCommandBarCore.Visible = true;
        this.adxOlExplorerCommandBarCore.FolderName = "*";
    }
}


Note that you run too heavy code in CommandBarsUpdate; Outlook reacts more slowly in this case. Besides, modifying command bars or command bar controls in this event isn't a good idea because every such change should produce another CommandBarsUpdate. I don't know how Office deals with this scenario but I don't think they solve it to your advantage.

Regards from Belarus (GMT+2),

Andrei Smolin
Add-in Express Team Leader
Posted 10 Aug, 2010 12:42:28 Top
Sridhar Kapavarapu




Posts: 59
Joined: 2009-07-29
Thanks Andrei, Now toolbar is working as expected.

#1.
With earlier versions(5.x), if i provide null value to FolderName property(this.adxOlExplorerCommandBarCore.FolderName = "") it worked. Is there any change in the FolderName property with latest version of add-in?

#2.
Note that you run too heavy code in CommandBarsUpdate; Outlook reacts more slowly in this case. Besides, modifying command bars or command bar controls in this event isn't a good idea because every such change should produce another CommandBarsUpdate. I don't know how Office deals with this scenario but I don't think they solve it to your advantage.


Requirement is, our toolbar should be movable to any place without loosing it's controls(Buttons or Textbox).
Problem we faced is, if i drag my toolbar as far as possible to the right of the screen, we are loosing text box. To eliminate this, i am always checking the width of toolbar. if toolbar width is less than the original, move the toolbar to the previous location. If still loosing the text box, move it to the original location.

I already posted my problem in add-in forum long back, also posted the solution which i am going to use in our code to eliminate this problem, I received a positive reply. So, i continued with this solution. Please have look at this links.

http://www.add-in-express.com/forum/read.php?FID=5&TID=6205&MID=30768#message30768

http://www.add-in-express.com/forum/read.php?FID=5&TID=5796&MID=28682

Please suggest me, what event should i use to meet my above requirement.

Thanks again.

Regards
Sridhar K.
Posted 11 Aug, 2010 02:27:39 Top