?
Solved

Getting an external Common Name / Not a member : Evaluate

Posted on 2004-09-29
13
Medium Priority
?
554 Views
Last Modified: 2013-12-18


Hi All,

I've got a small problem.  I'm trying to get  the common name of an external e-mail address.  I'm using the From field on the memo form and it's not as easy as doing Left and Rights due to the unpredictable format of the external email addresses.  For example the From field could be:
"Richard Starkey" <rstarkey@mail.com> or
Richard Starkey <rstarkey@mail.com> or
richardstarkey@mail.com

I've been trying to use the evluate statement to get the Given Name to see how this would work but keep getting a script error: "Not a member : Evaluate".  Below is the pertinent code in my script..

--------------
Dim sess as New NotesSession
Dim externalPrincipal as Variant
externalPrincipal = sess.Evaluate("@Name([G]; From)", maildoc)
-------------

Anybody know what I'm doing wrong or a better way to do it?
0
Comment
Question by:RichardStarkey
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
  • 3
  • +1
13 Comments
 
LVL 19

Expert Comment

by:madheeswar
ID: 12187643
How about using "Principal"?
tmpname=doc.Principal
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 12188221
If you want to play around with names, use the NotesName object.

    Dim nn= New NotesName(maildoc.From(0))

There are many properties that can be retrieved from a NotesName. Please see the Help-db.
0
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 12190165
Use @Name(Phrase];From) to get Richard Starkey or "Richard Starkey"

For internet address.. use @Name([Address821]; From).. which returns rstarkey@mail.com

~Hemanth
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 12190391
Why use Evaluate in this case?
0
 

Author Comment

by:RichardStarkey
ID: 12223112
I tried using maildoc.Principal at first but the external mails don't always have a Principal field.

I've also tried playing around with the NotesName option.  But I found a problem with this is in that the From field wasn't recognised as a names field on an external mail so I got a type mismatch error.  

I would give the @Name([Phrase]; From) a go but when I try to save I still get the "Not a memeber : Evaluate" error message!

To be honest, having looked at it I don't think it is that simple anyway.  I basically need the value that is displayed in the 'Who' column of the users Inbox and formula for that is pretty complicated.
0
 

Author Comment

by:RichardStarkey
ID: 12223145
Hi All,
I've worked out the "Not a member : Evaluate" error message.  Evaluate is a standalone function and is not a member of the NotesSession class.  So just using the following does not through an error:
externalPrincipal = Evaluate("@Name([G]; From)", maildoc)

Unfortunaltey, the From field on an external mail is not recognised as a notes name so none of the @Name abbreviations work anyway!

0
 
LVL 46

Accepted Solution

by:
Sjef Bosman earned 700 total points
ID: 12224708
Hi RichardStarkey,

> I've also tried playing around with the NotesName option.  But I found
> a problem with this is in that the From field wasn't recognised as a
> names field on an external mail so I got a type mismatch error.  

The type mismatch error cannot be caused by the CONTENT of the From field. It is a LotusScript error, it means that either maildoc is not an object, or the From-field has not a string value, or somehow the nn went wrong. I'll give you the longer version:

    Dim nn As NotesName
    Dim nname As String

    nname= maildoc.From(0)
    Set nn= New NotesName(nname)

Please check if this fails as well, and tell me which line fails.


Sjef
0
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 12227151
Even script object NotesName has phrase component... Check Addr822Phrase property in NotesName class

No one restricts you from not going for evaluate.. there is no reason.. that simple.

> Unfortunaltey, the From field on an external mail is not recognised as a notes name so none of the @Name abbreviations work anyway!

This is confusing... If you are working on the mail document then you should have from field , no matter where it is generated !
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 12227386
Hemantha, it almost makes you think that maildoc isn't a mailed document at all!
0
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 12227673
that is what it looks like...when he mentions about @name not recognizing the parts of the name
0
 

Author Comment

by:RichardStarkey
ID: 12232698

Thanks!  I think we've got it working.  Sjef - I pasted in the longer version of the code from above and it seems to get the values.  I can then use notesname.common to get the part of the name I want.  
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 12235458
Great! Thanks for the points. Eh, are you in any way related to the, eh, drummer...? Or a big fan?
0
 

Author Comment

by:RichardStarkey
ID: 12304328


Alas no relation!  Just a fan of the band!!
0

Featured Post

Enroll in August's Course of the Month

August's CompTIA IT Fundamentals course includes 19 hours of basic computer principle modules and prepares you for the certification exam. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

IBM Notes offer Encryption feature using which the user can secure its NSF emails or entire database easily. In this section we will discuss about the process to Encrypt Incoming and Outgoing Mails in depth.
Sometimes clients can lose connectivity with the Lotus Notes Domino Server, but there's not always an obvious answer as to why it happens.   Read this article to follow one of the first experiences I had with Lotus Notes on a client's machine, my…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

764 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