Board index » delphi » Trouble getting SenderName fro Outlook97 InBox folder

Trouble getting SenderName fro Outlook97 InBox folder

Retrieveing messages from Outlook 97 via Delphi 3.0

Has anybody succeded in retrieving the
"SenderName" of a message in the inbox folder?

Calling the SenderName (From) property results in the following:

  ...raised an exception class EOleError with message
  'Method 'SenderName' not supported bu automation object'
  Process stopped Use Setp or Run to continue.

I should thought that SenderName was one of
the most important fields in the message.
Most other info (Body,Subject,EntryId,Size) is receved OK.

- Cut from my Delphi 3.0 program -------------------

procedure TForm1.TTY(Msg: string);
begin
  with Memo1.Lines do Add(Msg);
end;
.
 MyNameSpace := MyOutlook.GetNamespace('MAPI');
 MyPages:=      MyNameSpace.Logon('MyUser','MyPassword',false,true); // no
dialogue
 MyFolder :=    MyNameSpace.GetDefaultFolder(olFolderInbox);

 TTY('#-of msg in Folder: '+MyFolder.Name+'
('+IntToStr(MyFolder.Items.Count)+')');
 for i:=1 to MyFolder.Items.Count do begin
//   TTY('(SenderMame):'+MyFolder.Items(i).SenderName);
     TTY('(subject)   :'+MyFolder.Items(i).Subject);
     TTY('(body)      :'+MyFolder.Items(i).Body);
     TTY('(EntryId)   :'+MyFolder.Items(i).EntryId.SenderName);
     TTY('(Size)      :'+IntToStr(MyFolder.Items(i).Size)
 end;
.
.
- Cut end ----------------------------
Appreceate any help on this problem.

Sigmund Fjellberg
TELKO A/S
supp...@telko.no

 

Re:Trouble getting SenderName fro Outlook97 InBox folder


See my reply to your other post on this question

Ross Martin

Re:Trouble getting SenderName fro Outlook97 InBox folder


On 17 Mar 98 08:17:35 GMT, "Knut M. Hansen" <supp...@telko.no> wrote:

(:>Has anybody succeded in retrieving the
(:>"SenderName" of a message in the inbox folder?

Nope, haven't tried it but I would have thought that...

(:>TTY('(EntryId)   :'+MyFolder.Items(i).EntryId.SenderName);
   TTY('(EntryId)   :'+MyFolder.Items(i).EntryId.Name);

Might work better. The descriptions used in the ObjectIspector are
always used for other thngs like "Font", "Color" etc etc, so maybe
Name will do what you want??

Peter

The Aluminator Holsters
http://aluminator.tierranet.com
(Excuse typo's as I hack at 60+wpm and don't re-read)
(Spelling errors are better than NO reply at all <G>)

Other Threads