?
Solved

Using LotusScript, how can you get the Notes name of a document's sender

Posted on 2004-09-08
10
Medium Priority
?
928 Views
Last Modified: 2013-12-18
I have been pouring through the Notes classes, trying to find a method with which I can get the Notes name of the sender so that I can script an automated reply.

What I have been asked to do is script an action button that managers in various locations can send out to their associates. The button will obtain some information from their systems and return it to the sender in an auto generated email. I have all the functinality working except that I had to hard code my email address in the code in order for it to work properly. If I could I would just out instructions for the managers on how to edit the button and replace my email address with theirs, but they don't have designer licenses so they cannot perform the edits.

I was thinking that there must be a way to grab the email address of the sender, store it in a variable and then call the doc.send to that variable.

The pertinent code is listed below, and I appreciate any and all help.

Thanks,
Jeff

     'set environment for the return document      
     Set uidoc = ws.CurrentDocument
     Set doc = uidoc.Document
      
     'setup the return document
     Set db = session.CurrentDatabase
     Set rtdoc = New NotesDocument (db)
     Set rtitem = New NotesRichTextItem (rtdoc, "body")
     rtdoc.Subject = "Re: " & doc.Subject (0)
     rtdoc.Body = sMessage$ & nl$ & sBuf$
      
     'send doc back to admin
     Call rtdoc.Send(False, "Jeffrey Petter/EMPL/NY/Verizon@VZNotes")
0
Comment
Question by:jpetter
[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
10 Comments
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 12006786
It's not in one of the classes, it is a field in a mail document. Look in the Document Properties, you'll need the From field probably.
0
 

Author Comment

by:jpetter
ID: 12006808
I'll give it a try and let you know how I make out.

Thanks,
Jeff
0
 
LVL 46

Accepted Solution

by:
Sjef Bosman earned 1200 total points
ID: 12006816
Something like:

    rtdoc.SendTo= doc.From(0)
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 24

Assisted Solution

by:HemanthaKumar
HemanthaKumar earned 800 total points
ID: 12006919
Use doc.Principal(0) instead of From , it gives more fidelity

~Hemanth
0
 

Author Comment

by:jpetter
ID: 12007132
Awesome....truly amazing. I feel embarrased with the amount of time I spent trying to find a class method with a "get" type function, along with all my other strange ideas. In a matter of minutes I receive two solutions that worked. Again, amazing.

I feel it would be only fair to split points on this.

Thanks again!,
Jeff
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 12007154
Lots of standard mails don't even have the Principal field. So watch out with that one. How's that about fidelity?

Sjef ;)
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 12007160
Thanks Jeff!
0
 

Author Comment

by:jpetter
ID: 12007213
No, I thank you.

Is it true that some mail does not have the Principal field? Would that be governed by the template?

Thanks,
Jeff
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 12007443
Only Notes-generated mail has the Principal field. If present, it is okay to use it, if not then use From. The Principal field is used to indicate the name on behalf of whom a mail is sent, e.g. by a secretary. From will contain the name of the secretary, Principal the name of the boss.
0
 

Author Comment

by:jpetter
ID: 12007670
Thanks for the explanation.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

I thought it will be a good idea to make a post as it will help in case someone else faces these issues. I trust this gives an idea how each entry in Notes.ini can mean a lot for the Domino Server to be functioning properly. This article discusses t…
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…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
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

762 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