HowTo: Add a toolbar to "new mail" inspector

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

HowTo: Add a toolbar to "new mail" inspector
 
Thanasis Boukouvalas




Posts: 40
Joined: 2006-06-17
Hi

I have a ADXOlInspectorCommandBar configured for ItemTypes = Mail, and I was hoped to see the toolbar in already sent or received mail items and in new mails (not sent) too.
It is visible only for already sent (or received) mails.

Is there any other property I should set to accomplish it?
Posted 17 Jun, 2006 10:50:32 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Hi Thanasis.

Did you change the FolderName or FolderNames properties of the ADXOlInspectorCommandBar component?
Also please try our MyFirstOutlookAddin example from the ADX installation package? Does it work for you?
Posted 19 Jun, 2006 07:27:38 Top
Thanasis Boukouvalas




Posts: 40
Joined: 2006-06-17
Hi Sergey

I've tried the same thing on Windows XP and Office 2003 and everything is OK.
I met the above problem on Windows 2000 server and Office 2000.

I'm not using FolderName or FolderNames because I'd like my command bar appeared in any mail inspector.

Posted 19 Jun, 2006 08:04:14 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Thanasis, do you use Word as an editor for new messages in Outlook 2000?
Posted 19 Jun, 2006 08:20:35 Top
Thanasis Boukouvalas




Posts: 40
Joined: 2006-06-17
Thanasis, do you use Word as an editor for new messages in Outlook 2000?

Yes
Posted 19 Jun, 2006 08:25:44 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
In this case your command bar will not be visible. This is the known issue of Outlook 2000. Please read the following article:
http://support.microsoft.com/default.aspx?scid=KB;en-us;Q201095
(the 'Considerations When You Use Microsoft Word as the E-Mail Editor
' section)
Posted 19 Jun, 2006 08:45:25 Top
Thanasis Boukouvalas




Posts: 40
Joined: 2006-06-17
So, in Office XP and Office 2003 I will not have any restrictions about inspector command bars even if Word is the editor of new mail messages?

Is it possible to have a command bar in new mail inspector and another command bar in already send/received mails inspector?
Posted 19 Jun, 2006 09:11:57 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
So, in Office XP and Office 2003 I will not have any restrictions about inspector command bars even if Word is the editor of new mail messages?

Yes, correct.


Is it possible to have a command bar in new mail inspector and another command bar in already send/received mails inspector?

You can download an example here:
http://www.add-in-express.com/projects/newmessageexample.zip
Posted 19 Jun, 2006 09:20:11 Top
Pascal Groulx




Posts: 9
Joined: 2006-08-01
Hi everybody,

I want to do something similar in my add-in, except for contact item. I tried myself but cant figure it out, my commandbar is always there. So I tried your example and its working fine. Can you check at my code and find what im doing wrong.


private void adxOutlookEvents_InspectorActivate(object sender, object inspector, string folderName)
{
	Microsoft.Office.Interop.Outlook._Inspector oInspector = null;
	Microsoft.Office.Interop.Outlook._ContactItem oContact = null;
	Microsoft.Office.Interop.Outlook.UserProperties oProperties = null;
	Microsoft.Office.Interop.Outlook.UserProperty oProperty = null;
	object currentItem = null;

	if ( folderName.IndexOf("Contacts") > -1 && inspector != null )
	{
		oInspector = (inspector as Microsoft.Office.Interop.Outlook._Inspector);
		if ( oInspector != null )
		{
			try
			{
				currentItem = oInspector.CurrentItem;
				if ( currentItem is Microsoft.Office.Interop.Outlook._ContactItem )
				{
					oContact = (currentItem as Microsoft.Office.Interop.Outlook._ContactItem);
					if ( oContact != null )
					{
						if ( oContact.Categories == "SUM" )
						{									
							oProperties = oContact.UserProperties;
							oProperty = oProperties["Guid"];

							bool Flag = (oProperty != null);
							this.adxInspectorCommandBar.Enabled = Flag;
							this.adxInspectorCommandBar.Visible = Flag;
						}
					}
				}
			}
			catch
			{}
		}
	}

	if ( currentItem != null ){while(Marshal.ReleaseComObject(currentItem) > 0){}currentItem = null;}
	if ( oProperty != null ){while(Marshal.ReleaseComObject(oProperty) > 0){}oProperty = null;}
	if ( oProperties != null ){while(Marshal.ReleaseComObject(oProperties) > 0){}oProperties = null;}
	if ( oContact != null ){while(Marshal.ReleaseComObject(oContact) > 0){}oContact = null;}
}
Posted 01 Aug, 2006 09:06:32 Top
Pascal Groulx




Posts: 9
Joined: 2006-08-01
Forget that, I made it work!
Posted 01 Aug, 2006 09:27:21 Top