More Outlook Resource Sites

Microsoft Developer Network (MSDN)

FAQs and other general resources

Login

login
password
Remember me

You will need to register and log in if you want to download the source code for the Microsoft Outlook Programming book. The forums and code sharing areas are open to both registered and non-registered visitors.

share code 02-Sep-2010 22:24

Looking for help with Outlook programming projects — VSTO, add-ins, VBA, custom Outlook forms, etc.? You′ve come to the right place!

NEW! >> Subscribe to this site via RSS. For more RSS options, see the complete list of feeds on our main news page.

 

Code level: advanced    Code area: Outlook and .NET Printer Friendly Version
Title: CommandBar & ExplorerWrapper c# example
Description: Wrapping an Explorer, Create a CommandBar, ComboBox, Button...
Date: 25-Feb-2005  21:30
Code level: advanced
Code area: Outlook and .NET
Posted by: Helmut Obertanner
Body:
All 89comments
Page [ 1 2 3 4 5 6 7 8 9 Next >>  
  08-Mar-2005  19:44   
I'm getting a "Specfied Class is not valid" exception on this line myExplorers = (Ol.ExplorersClass) myApplicationObject.Explorers; in OnStartupComplete.

Any ideas how this code worked?
  08-Mar-2005  19:45   
I meant to write "Specified Cast is not valid"
  09-Mar-2005  02:47   
Remove reference to Office.dll and ad new reference to COM Office Dll.
The original Reference created with VisualStudion Wizard points to wrong dll.

Greets, Helmut Obertanner
  10-Mar-2005  15:31   
I am also using this example as a guideline with the COM Office 11.0 library and Outlook 2003. I am also getting a similar error. Should I be doing anything different?

Basically I am dealing with a similar issue where my menu events disappear after I open a Windows form. I defined a NewExploere event but I find that it never gets triggered. Now I am trying to test if the close event(taking cues from your example) is getting triggered after the form is called. That is where I have run into the above exception at run time.

Any help you can provide will be greatly appreciated.
Thanks,
Poonam
  11-Mar-2005  02:48   
Hello Mr. Muragi,
Have you also removed the Office DLL from your project references ?

Greets, Helmut Obertanner
  11-Mar-2005  22:56   
Yes I did remove it, but somehow I still could not get it to work. But I have found another solution to the problem:

1) Define an Activate event handler for the Explorer object - this is a definition I got to work after quite a struggle:

Outlook.Explorer oActiveExplorer;

// Cast this correctly - very important - this is required because it has both an event
// and method named Activate

Outlook.ExplorerEvents_10_Event eActiveExplorer = (Outlook.ExplorerEvents_10_Event)oActiveExplorer;

eActiveExplorer.Activate +=new Outlook.ExplorerEvents_10_ActivateEventHandler(onActivateExplorer);

And in method for the event handler:

onActivateExplorer()
{
// Build the menu - in this, if the menu already exists, recreate the event handlers

}

This is all working now - thanks Helmut for your tips.
Poonam
 
  22-Mar-2005  09:17   
Hi,

I have copied all the three files but still i am not able to see any bar.
I have installed the addin.
Please help.

Thanks and regards,
Mohit
  22-Mar-2005  09:21   
Hello mohit,
please change the following in Connect.cs from:
[GuidAttribute("9B73D13F-0476-4E16-86EF-A3A6B54EFFA8"), ProgId("XConnect.AddIn")]
to
[GuidAttribute("9B73D13F-0476-4E16-86EF-A3A6B54EFFA8"), ProgId("XConnect.Connect")]

Greets, Helmut Obertanner
  22-Mar-2005  17:00   
Hi Helmut,

Great!!! it's working fine now.
is there any way to add a context menu item when we right click on the email address in the email (TO CC BCC)list.

Thanks and Regards,
Mohit
  23-Mar-2005  02:12   
Hello Mohit,
haven't done so, so I'm not sure.
But the contaxtmenu is also a CommandBar wich maybe could be identified by it's name.

Greets, Helmut Obertanner
 
Page [ 1 2 3 4 5 6 7 8 9 Next >>  
Post your comment



name        email