Starting Questions?

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

Starting Questions?
Outlook MailItem and Forward Screen 
Michael Wakkinen




Posts: 1
Joined: 2005-02-24
Hello,

I just went though the outlook addin wizard and now have a fresh new project. I've added and InspCommandBar, and a button in it. I added a showmessage procedure to it's onclick event.

First Question: in my onclick event I just want to show some details about the mailitem I have. My code looks like this:

procedure TAddInModule.InspCommandbarControls0Click(Sender: TObject);
begin
showmessage(OutlookApp.ActiveInspector.Caption+CRLF+(OutlookApp.ActiveInspector as MailItem).Body);

end;

This fails with message:

Error:
OlAddIn error: the add-in has fired an exception.
Interface not supported

I remove the (OutlookApp.ActiveInspector asMailItem).Body
and I get the caption of the current inspector window without error what am I doing wrong?


Second Question:
how would I hide my button and only show it when a message is being forwarded?

Thanks for any help that's out there!

Michael
Posted 24 Feb, 2005 16:02:29 Top
Dmitry Kostochko


Add-in Express team


Posts: 2745
Joined: 2004-04-05
Hi Michael,

First Question:

Try the code below:
showmessage(OutlookApp.ActiveInspector.Caption+
CRLF+(OutlookApp.ActiveInspector.CurrentItem as MailItem).Body);

Second Question:

Very interesting question... You can freely operate on any inspector controls via the OnInspectorActivate event. But I don't know how to properly determine if a message has been forwarded. There are several ways but they don't work on all Outlook versions.

Posted 25 Feb, 2005 05:23:42 Top