Link to home
Start Free TrialLog in
Avatar of dyancer
dyancer

asked on

Selection of items in Outlook ActiveExplorer object.

Hello Experts,
 I need a way to select some item(s) in the Outlook ActiveExplorer using the Outlook objects.

thanx.
Avatar of darkloser
darkloser

listening...
hi,
I think I can help but I need more infos on what you want to do...
Do you want to use com addin for that ? is this for you com addin ?
Tell me :)

John
Avatar of dyancer

ASKER

Hi,
I do capturing of outlook messages to some knowledge managment database....the user can ask to go-back-to-source, so i need to open outlook and to browse to the same view when i captured it... focusing in the message itself in outlook.

i'm using Outlook objects.

thanx.
You mean the components provided by delphi ???
What is the reference you have on the message ? Do you have
something more then the title ?

Will you have enough if I show you how to open outlook and I select a message ?
What is the reference about the mail ?
Is the mail stored in a local pst, or is it on the exchange server ?
Avatar of dyancer

ASKER

jeurk,

its Will be enough if u show how to open outlook and Select a message if given the Message unique ID

thanx
Hi,
It's ok. I think that this will be easy...
But because of the short amouth of time I have you will probably only get a sample from me by the end of the week.
I try to make it earlier... but I prefer to tell you.

John.
Hi,
Here is the sample I promissed. It took me exactly one
hour (ok I was also on the phone)...
If it's what you want, give me an A please. If it's not that, give me more details. I'll help you until you are satisfied enought to give me an A :)
Thank you.
John.

---------------------
works with D5 and outlook 2k sp1a
first click on button 1, then on btn 2 ;)
---------------------

unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls,
  ComObj, ActiveX,
  Outlook2000;

type
  TForm1 = class(TForm)
    Button1: TButton;
    Button2: TButton;
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
  private
    { Declarations privees }
  public
    { Declarations publiques }
  end;

var
  Form1: TForm1;
  MailID: Widestring;
  Outlook: _Application;                // OutlookApplication; for D5 users
  NmSpace: NameSpace;
  Folder: MAPIFolder;

implementation

{$R *.DFM}

procedure TForm1.Button1Click(Sender: TObject);
var
  Unknown: IUnknown;
  Result: HResult;
  Mail: MailItem;
begin
  {$IFDEF VER120}                       // Delphi 4
  Outlook := CoApplication_.Create;
  {$ELSE}                               // Delphi 5
  Outlook := CoOutlookApplication.Create;
  {$ENDIF}

  NmSpace := Outlook.GetNamespace('MAPI');
  NmSpace.Logon('', '', False, False);
  //get the folder that holds the input mail
  //Folder := NmSpace.Folders.Item(2); //1 based
  Folder := NmSpace.GetDefaultFolder(olFolderInbox);
  //show it
  Folder.Display;
  //get the third email, just for the purpose of the demo
  //the 3 mail is maybe not at the 3 slot in the mailbox...
  mail := Folder.Items.Item(3) as MailItem; //1 based
  MailID := Mail.Get_EntryID;
end;


procedure TForm1.Button2Click(Sender: TObject);
var
  Mail: MailItem;
begin
  //get the item corresponding to the id you have stored
  Mail := NmSpace.GetItemFromID(MailID, EmptyParam) as MailItem;
  //display the mail...
  Mail.Display(EmptyParam);
end;

end.

Avatar of dyancer

ASKER

hi John,

Indeed this does not answer my question at all...
what u have done is displaying a message in the Inspector,
what i need to do is open the outlook in the normal state which  mean, the folder tree and the email item list in the above and the preview of the email...
again, what im trying to do is when given an message ID to open outlook and SELECT this message in the email list and preview this email. not opening the message in the inspector.
I don't understand...

You mean:
1 - open outlook
2 - select the mail (in outlook)...

That's all... by select you just mean the mail gets highlighted in the mail list in outlook ??
and if the preview pane is visible the mail shows up...

Is this it ? If not maybe you can send me a screenshot that shows what you want... knipjo@hotmail.com

thanks...
Avatar of dyancer

ASKER

jeurk...
That's exactly what im after.


thanx for your help.
Avatar of dyancer

ASKER

Increasing points to 300... Any takers?
Here I am ;)

In fact I think you have  a pretty good level in outlook
stuff, don't you?

I looked at this a couple of hours yesterday...
The problem seems unsolvable...

The selection is readonly... the mailitem has no activate method.
The explorer currentitem cannot be changed...

So I don't see what can be done.

The find method can be used to find your item but the selection is not changed...

Maybe we could filter the view to only show the item you want but the problem is that your user may already have filter or the view is configured to show by sender for exmeple... that way your items don't show at all at first.

What have you tryed ???

All the exemple I can find, microsoft or not don't change the selection...
Avatar of dyancer

ASKER

Jeurk....
  The way you describe it, what u done is the top level i get to for no avail... it seems unsolvable problem using the Outlook Objects...
but, i never guve up.. and u experts guys should do the same, the problem is somehow solvable... i don't get a clue how to, but i believe there is someway to do it!

PLUS :
im increasing the points to 400 points... it worth trying to solve it...

Thanx in advance..
Dyancer

p.s : answers stating and proving in any way that this is a unsolvable problem will be rejected, Sorry.


Avatar of dyancer

ASKER

Again....+100

it's already 400 Points, The Max that i can give for this Question.
hope it will be worth thinking for answer...
Could you explain me why you just want the mail to get selected ?
Why don't you like it to do a display ??
I know it's intrusive...

Or even show the mail somewhere else, this would all be much easier...at least it can be done...
Have you noticed that not even outlook is able to do it...
When you get a mail notification, you can double click on the systray to jump right to your mail, and the best outlook can do is to open the right folder...
Avatar of dyancer

ASKER

Jeurk...
i find a solution, it's not nice and sophisticated one, and im not going to adopt it only if the boss insists :-(
it's about sendin g KeyStrokes to outlook email-list...

See this URL for full explanation
http://groups.google.com/groups?q=outlook+AND+change+AND+selection&safe=off&rnum=1&selm=8gjr62$kqc$1@nnrp1.deja.com
Avatar of dyancer

ASKER

Jeurk...
i find a solution, it's not nice and sophisticated one, and im not going to adopt it only if the boss insists :-(
it's about sendin g KeyStrokes to outlook email-list...

See this URL for full explanation
http://groups.google.com/groups?q=outlook+AND+change+AND+selection&safe=off&rnum=1&selm=8gjr62$kqc$1@nnrp1.deja.com
Good luck :)
Avatar of dyancer

ASKER

Pointe Adjusted to 400
Im still interested
I know :) I'm too.
I actually asked Microsoft what I can do ;)
Really, I should get the answer pretty soon.
But I imagine the answer will be that it cannot be done :(
I'll let you know.
Avatar of dyancer

ASKER

Thanx Buddy,
it's kind of you :-)

Hassan.
ASKER CERTIFIED SOLUTION
Avatar of jeurk
jeurk

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of dyancer

ASKER

thanks every one..

i need to know what to do in this case.
should i give the points... and to whom....

any suggestions
except darkloser, I was the only one talking to you ;)
I think you should ask the support to let you accept that question without giving the points because they was no solution, just to let people know that there is no solution for that...
Question(s) below appears to have been abandoned. Your options are:
 
1. Accept a Comment As Answer (use the button next to the Expert's name).
2. Close the question if the information was not useful to you. You must tell the participants why you wish to do this, and allow for Expert response.
3. Ask Community Support to help split points between participating experts, or just comment here with details and we'll respond with the process.
4. Delete the question. Again, please comment to advise the other participants why you wish to do this.

For special handling needs, please post a zero point question in the link below and include the question QID/link(s) that it regards.
https://www.experts-exchange.com/jsp/qList.jsp?ta=commspt
 
Please click the Help Desk link on the left for Member Guidelines, Member Agreement and the Question/Answer process.  Click you Member Profile to view your question history and keep them all current with updates as the collaboration effort continues, in the event new items have been created since this listing was pulled.

https://www.experts-exchange.com/jsp/cmtyHelpDesk.jsp

To view your open questions, please click the following link(s) and keep them all current with updates.
https://www.experts-exchange.com/questions/Q.20044312.html
https://www.experts-exchange.com/questions/Q.20096486.html
https://www.experts-exchange.com/questions/Q.20172391.html
https://www.experts-exchange.com/questions/Q.20193902.html
https://www.experts-exchange.com/questions/Q.20227603.html
https://www.experts-exchange.com/questions/Q.20235247.html
https://www.experts-exchange.com/questions/Q.20260351.html


PLEASE DO NOT AWARD THE POINTS TO ME.  
 
------------>  EXPERTS:  Please leave any comments regarding this question here on closing recommendations if this item remains inactive another three days.
 
Thank you everyone.
 
Moondancer
Moderator @ Experts Exchange


P.S.  For any year 2000 questions, special attention is needed to ensure the first correct response is awarded, since they are not in the comment date order, but rather in Member ID order.
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

accept jeurk's comment as answer

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

Thanks,

geobul
EE Cleanup Volunteer