Solved

Selection of items in Outlook ActiveExplorer object.

Posted on 2001-08-22
27
737 Views
Last Modified: 2012-05-05
Hello Experts,
 I need a way to select some item(s) in the Outlook ActiveExplorer using the Outlook objects.

thanx.
0
Comment
Question by:dyancer
  • 12
  • 12
  • +2
27 Comments
 
LVL 1

Expert Comment

by:darkloser
ID: 6423723
listening...
0
 
LVL 4

Expert Comment

by:jeurk
ID: 6425312
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
0
 
LVL 1

Author Comment

by:dyancer
ID: 6425968
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.
0
 
LVL 4

Expert Comment

by:jeurk
ID: 6426145
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 ?
0
 
LVL 1

Author Comment

by:dyancer
ID: 6426201
jeurk,

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

thanx
0
 
LVL 4

Expert Comment

by:jeurk
ID: 6428115
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.
0
 
LVL 4

Expert Comment

by:jeurk
ID: 6438739
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.

0
 
LVL 1

Author Comment

by:dyancer
ID: 6439618
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.
0
 
LVL 4

Expert Comment

by:jeurk
ID: 6440968
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...
0
 
LVL 1

Author Comment

by:dyancer
ID: 6441653
jeurk...
That's exactly what im after.


thanx for your help.
0
 
LVL 1

Author Comment

by:dyancer
ID: 6456309
Increasing points to 300... Any takers?
0
 
LVL 4

Expert Comment

by:jeurk
ID: 6456428
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...
0
 
LVL 1

Author Comment

by:dyancer
ID: 6456814
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.


0
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 
LVL 1

Author Comment

by:dyancer
ID: 6456872
Again....+100

it's already 400 Points, The Max that i can give for this Question.
hope it will be worth thinking for answer...
0
 
LVL 4

Expert Comment

by:jeurk
ID: 6457430
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...
0
 
LVL 4

Expert Comment

by:jeurk
ID: 6459957
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...
0
 
LVL 1

Author Comment

by:dyancer
ID: 6460465
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
0
 
LVL 1

Author Comment

by:dyancer
ID: 6460704
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
0
 
LVL 4

Expert Comment

by:jeurk
ID: 6462409
Good luck :)
0
 
LVL 1

Author Comment

by:dyancer
ID: 6468179
Pointe Adjusted to 400
Im still interested
0
 
LVL 4

Expert Comment

by:jeurk
ID: 6468591
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.
0
 
LVL 1

Author Comment

by:dyancer
ID: 6468678
Thanx Buddy,
it's kind of you :-)

Hassan.
0
 
LVL 4

Accepted Solution

by:
jeurk earned 300 total points
ID: 6528223
hi,
Like I thought:
MS Support on Office/VBA has confirmed that it is not possible to add
programmatically an element inside the selected list without the Display
method.

This is an official answer. Sorry.
Anyway I have no ideas on how to make this by hand...
John.
0
 
LVL 1

Author Comment

by:dyancer
ID: 6534017
thanks every one..

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

any suggestions
0
 
LVL 4

Expert Comment

by:jeurk
ID: 6534468
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...
0
 
LVL 1

Expert Comment

by:Moondancer
ID: 6840289
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.
http://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.

http://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.
http://www.experts-exchange.com/questions/Q.20044312.html
http://www.experts-exchange.com/questions/Q.20096486.html
http://www.experts-exchange.com/questions/Q.20172391.html
http://www.experts-exchange.com/questions/Q.20193902.html
http://www.experts-exchange.com/questions/Q.20227603.html
http://www.experts-exchange.com/questions/Q.20235247.html
http://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.
0
 
LVL 17

Expert Comment

by:geobul
ID: 9287966
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
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
This video discusses moving either the default database or any database to a new volume.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now