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

Inspectors event in VC++ ATL Programming



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old January 3rd 09, 05:35 PM posted to microsoft.public.outlook.program_addins
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Inspectors event in VC++ ATL Programming

From a high level perspective what we usually do is to create a class that
has the code to handle whatever Inspector and Inspector.CurrentItem events
we want to handle. Then as new Inspectors are opened and closed we use
NewInspector to instantiate instances of the Inspector handler class and add
them to a list or collection to keep them alive.

Then in the first Activate event of the new Inspector we instantiate the
CommandBar interfaces. In Outlook 2007 the Inspector.CommandBars collection
isn't there until that Activate fires.

When Inspector.Close fires we kill the object references in the class for
that Inspector and remove it from the list or collection.

When you create a new CommandBarButton object you give it a unique Tag
property value. I usually use a GUID plus a key value for the Inspector to
make a unique tag. The unique Tag prevents any Click events from the button
from firing in more than one instance of the Inspector handler class.

Check out www.outlookcode.com for any Inspector handler class code samples.
As I recall, there might be a C++ example, certainly there are C# examples
there. I also have VS2005 templates for COM addins in C# on my Web site as
part of my book samples (no C++ examples though, sorry).

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"Jayashree Sekar" wrote in message news:...
Message-ID:
X-Mailer: http://www.umailcampaign.com, ip log:61.247.251.29
Newsgroups: microsoft.public.outlook.program_addins
NNTP-Posting-Host: 22.bb.5446.static.theplanet.com 70.84.187.34
Path: TK2MSFTNGP01.phx.gbl!TK2MSFTNGP06.phx.gbl!newspe.c om
Lines: 1
Xref: TK2MSFTNGP01.phx.gbl microsoft.public.outlook.program_addins:29996

Hi Henry,

My requiremet is similar to Abdulla's. I need to include a custom toolbar
with some buttons in all inspectors which are of message class 'IPM.Post'.
I
use VC++ in my project.

First, I tried handling OnNewInspector event in which I tried inserting my
custom toolbar & advising the commandBar button event. This worked fine
for
the first inspector(i.e. when I click new MailMessage for the first time)
&
the problem raised when I tried opening another mail message. Technically
the problem was, I was not able to advise the commandBar button event for
the new inspector when it was already advised for the previous inspector.

After surfing the net, I read that my task can be very well accomplished
if
I handle the 'Activate' & 'DeActivate' events of 'InspectorEvents'.

But to handle this 'Activate' & 'DeActivate' events of 'InspectorEvents',
I
again have to advise them in 'OnNewInspector' which again gives me the
same
problem.

Please help me out. This a very urgent requirement & I have already spent
more time on exploring this.

Awaiting for your help,
Shree

url:http://www.ureader.com/msg/1079162.aspx


Ads
  #2  
Old February 12th 09, 06:56 AM posted to microsoft.public.outlook.program_addins
Jayashree Sekar[_2_]
external usenet poster
 
Posts: 1
Default Inspectors event in VC++ ATL Programming

Hi Ken,

Sorry for a delayed reply & thank you so much for your inputs.

Finally, I created two VSTO 2005 addins in c#, one for inserting my toolbar
in Outlook 2003 mail-message & another for creating my ribbon in Outlook 2007
mail-message.

Can't we create a single addin to work with both Outlook 2003 toolbar &
Outlook 2007 ribbon??

In one of our non-development system with Outlook 2003, the Outlook 2003
addin fails to add my toolbar when we select the option "Use Microsoft Office
Word 2003 to edit e-mail messages" or when we select the option "Use
Microsoft Office Word 2003 to read Rich Text edit e-mail messages" in the
"Mail Format" tab of Outlook-Tools-Options. If we unselect those options,
it is loading successfully.

When the options are selected, I get an exception in the InspectorActivate
event handler(in the InspectorWrapper class where I create my CommandBar)
while executing the following line.

Microsoft.Office.Core.CommandBars m_cCmdBars = m_cInspector.CommandBars;
//m_cInspector - is the Inspector dispatch that we get in the newInspector
event

The raised exception is:

"Library not registered. (Exception from HRESULT: 0x8002801D
(TYPE_E_LIBNOTREGISTERED))"

I also checked the assembly and found the existence of
"Microsoft.Office.Interop.Outlook" version 11.0.0.0

Can you please help me out in solving this issue.

Thanks in Advance,
S.Jayashree

----------------------------------------------------------
"Ken Slovak - [MVP - Outlook]" wrote:

From a high level perspective what we usually do is to create a class that
has the code to handle whatever Inspector and Inspector.CurrentItem events
we want to handle. Then as new Inspectors are opened and closed we use
NewInspector to instantiate instances of the Inspector handler class and add
them to a list or collection to keep them alive.

Then in the first Activate event of the new Inspector we instantiate the
CommandBar interfaces. In Outlook 2007 the Inspector.CommandBars collection
isn't there until that Activate fires.

When Inspector.Close fires we kill the object references in the class for
that Inspector and remove it from the list or collection.

When you create a new CommandBarButton object you give it a unique Tag
property value. I usually use a GUID plus a key value for the Inspector to
make a unique tag. The unique Tag prevents any Click events from the button
from firing in more than one instance of the Inspector handler class.

Check out www.outlookcode.com for any Inspector handler class code samples.
As I recall, there might be a C++ example, certainly there are C# examples
there. I also have VS2005 templates for COM addins in C# on my Web site as
part of my book samples (no C++ examples though, sorry).

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"Jayashree Sekar" wrote in message news:...
Message-ID:
X-Mailer: http://www.umailcampaign.com, ip log:61.247.251.29
Newsgroups: microsoft.public.outlook.program_addins
NNTP-Posting-Host: 22.bb.5446.static.theplanet.com 70.84.187.34
Path: TK2MSFTNGP01.phx.gbl!TK2MSFTNGP06.phx.gbl!newspe.c om
Lines: 1
Xref: TK2MSFTNGP01.phx.gbl microsoft.public.outlook.program_addins:29996

Hi Henry,

My requiremet is similar to Abdulla's. I need to include a custom toolbar
with some buttons in all inspectors which are of message class 'IPM.Post'.
I
use VC++ in my project.

First, I tried handling OnNewInspector event in which I tried inserting my
custom toolbar & advising the commandBar button event. This worked fine
for
the first inspector(i.e. when I click new MailMessage for the first time)
&
the problem raised when I tried opening another mail message. Technically
the problem was, I was not able to advise the commandBar button event for
the new inspector when it was already advised for the previous inspector.

After surfing the net, I read that my task can be very well accomplished
if
I handle the 'Activate' & 'DeActivate' events of 'InspectorEvents'.

But to handle this 'Activate' & 'DeActivate' events of 'InspectorEvents',
I
again have to advise them in 'OnNewInspector' which again gives me the
same
problem.

Please help me out. This a very urgent requirement & I have already spent
more time on exploring this.

Awaiting for your help,
Shree

url:http://www.ureader.com/msg/1079162.aspx



  #3  
Old February 12th 09, 06:57 AM posted to microsoft.public.outlook.program_addins
Jayashree Sekar[_3_]
external usenet poster
 
Posts: 1
Default Inspectors event in VC++ ATL Programming

Hi Ken,

Sorry for a delayed reply & thank you so much for your inputs.

Finally, I created two VSTO 2005 addins in c#, one for inserting my toolbar
in Outlook 2003 mail-message & another for creating my ribbon in Outlook 2007
mail-message.

Can't we create a single addin to work with both Outlook 2003 toolbar &
Outlook 2007 ribbon??

In one of our non-development system with Outlook 2003, the Outlook 2003
addin fails to add my toolbar when we select the option "Use Microsoft Office
Word 2003 to edit e-mail messages" or when we select the option "Use
Microsoft Office Word 2003 to read Rich Text edit e-mail messages" in the
"Mail Format" tab of Outlook-Tools-Options. If we unselect those options,
it is loading successfully.

When the options are selected, I get an exception in the InspectorActivate
event handler(in the InspectorWrapper class where I create my CommandBar)
while executing the following line.

Microsoft.Office.Core.CommandBars m_cCmdBars = m_cInspector.CommandBars;
//m_cInspector - is the Inspector dispatch that we get in the newInspector
event

The raised exception is:

"Library not registered. (Exception from HRESULT: 0x8002801D
(TYPE_E_LIBNOTREGISTERED))"

I also checked the assembly and found the existence of
"Microsoft.Office.Interop.Outlook" version 11.0.0.0

Can you please help me out in solving this issue.

Thanks in Advance,
S.Jayashree

--------------------------


"Ken Slovak - [MVP - Outlook]" wrote:

From a high level perspective what we usually do is to create a class that
has the code to handle whatever Inspector and Inspector.CurrentItem events
we want to handle. Then as new Inspectors are opened and closed we use
NewInspector to instantiate instances of the Inspector handler class and add
them to a list or collection to keep them alive.

Then in the first Activate event of the new Inspector we instantiate the
CommandBar interfaces. In Outlook 2007 the Inspector.CommandBars collection
isn't there until that Activate fires.

When Inspector.Close fires we kill the object references in the class for
that Inspector and remove it from the list or collection.

When you create a new CommandBarButton object you give it a unique Tag
property value. I usually use a GUID plus a key value for the Inspector to
make a unique tag. The unique Tag prevents any Click events from the button
from firing in more than one instance of the Inspector handler class.

Check out www.outlookcode.com for any Inspector handler class code samples.
As I recall, there might be a C++ example, certainly there are C# examples
there. I also have VS2005 templates for COM addins in C# on my Web site as
part of my book samples (no C++ examples though, sorry).

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"Jayashree Sekar" wrote in message news:...
Message-ID:
X-Mailer: http://www.umailcampaign.com, ip log:61.247.251.29
Newsgroups: microsoft.public.outlook.program_addins
NNTP-Posting-Host: 22.bb.5446.static.theplanet.com 70.84.187.34
Path: TK2MSFTNGP01.phx.gbl!TK2MSFTNGP06.phx.gbl!newspe.c om
Lines: 1
Xref: TK2MSFTNGP01.phx.gbl microsoft.public.outlook.program_addins:29996

Hi Henry,

My requiremet is similar to Abdulla's. I need to include a custom toolbar
with some buttons in all inspectors which are of message class 'IPM.Post'.
I
use VC++ in my project.

First, I tried handling OnNewInspector event in which I tried inserting my
custom toolbar & advising the commandBar button event. This worked fine
for
the first inspector(i.e. when I click new MailMessage for the first time)
&
the problem raised when I tried opening another mail message. Technically
the problem was, I was not able to advise the commandBar button event for
the new inspector when it was already advised for the previous inspector.

After surfing the net, I read that my task can be very well accomplished
if
I handle the 'Activate' & 'DeActivate' events of 'InspectorEvents'.

But to handle this 'Activate' & 'DeActivate' events of 'InspectorEvents',
I
again have to advise them in 'OnNewInspector' which again gives me the
same
problem.

Please help me out. This a very urgent requirement & I have already spent
more time on exploring this.

Awaiting for your help,
Shree

url:http://www.ureader.com/msg/1079162.aspx



  #4  
Old February 12th 09, 03:56 PM posted to microsoft.public.outlook.program_addins
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Inspectors event in VC++ ATL Programming

Does that system have the PIA for Word and office installed in the GAC?

Other than that the only things I can think of to start out are to try to
find the differences in where the code works and where it doesn't. I'd start
by looking at the GAC and the Office installation first.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"Jayashree Sekar" Jayashree wrote in
message ...
Hi Ken,

Sorry for a delayed reply & thank you so much for your inputs.

Finally, I created two VSTO 2005 addins in c#, one for inserting my
toolbar
in Outlook 2003 mail-message & another for creating my ribbon in Outlook
2007
mail-message.

Can't we create a single addin to work with both Outlook 2003 toolbar &
Outlook 2007 ribbon??

In one of our non-development system with Outlook 2003, the Outlook 2003
addin fails to add my toolbar when we select the option "Use Microsoft
Office
Word 2003 to edit e-mail messages" or when we select the option "Use
Microsoft Office Word 2003 to read Rich Text edit e-mail messages" in the
"Mail Format" tab of Outlook-Tools-Options. If we unselect those
options,
it is loading successfully.

When the options are selected, I get an exception in the InspectorActivate
event handler(in the InspectorWrapper class where I create my CommandBar)
while executing the following line.

Microsoft.Office.Core.CommandBars m_cCmdBars = m_cInspector.CommandBars;
//m_cInspector - is the Inspector dispatch that we get in the newInspector
event

The raised exception is:

"Library not registered. (Exception from HRESULT: 0x8002801D
(TYPE_E_LIBNOTREGISTERED))"

I also checked the assembly and found the existence of
"Microsoft.Office.Interop.Outlook" version 11.0.0.0

Can you please help me out in solving this issue.

Thanks in Advance,
S.Jayashree


 




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
Inspectors event in VC++ ATL Programming Jayashree Sekar Add-ins for Outlook 0 January 3rd 09 01:13 PM
Multiple new mail Inspectors goran Add-ins for Outlook 0 January 23rd 08 02:11 AM
How attachments and inspectors work together LSM Add-ins for Outlook 0 January 31st 07 08:57 PM
Choice of programming tool for Outlook programming [email protected] Outlook and VBA 4 July 13th 06 10:48 AM
Errors when using Inspectors Yoav Outlook - Calandaring 1 March 23rd 06 02:47 PM


All times are GMT +1. The time now is 09:12 AM.


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.