Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 297
  • Last Modified:

Get selected item in inbox

hi guys,
first of all im new to notes programming, so please be patient...
here is my problem:
i need a function, that returns me the mailitem a user selects(not opens) in his/her inbox...
i want to add a button(i think its called agent in notes) in the inbox view and when somebody first selects a mail, then clicks on the button i want to work with the selected message (e.g. resend it to another address)...
is this possible? (i hope anyone understands what i am talking about)
i would be glad if someone answers...
0
beku
Asked:
beku
  • 6
  • 6
1 Solution
 
ArunkumarCommented:
Just use the Forward button and this email will be copied to a new memo and you can edit it before sending it to someone !!!

-Arun.
0
 
ArunkumarCommented:
You are lucky as you can select multiple mails and use Forward all the memos will be copied into a new mail.
0
 
ArunkumarCommented:
And...if you dont see the forward button already on the view you can find it in the Actions menu.
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
bekuAuthor Commented:
First of all thx for your Xtremly fast reply Arun...
but think you didnt understand my question(this is not a question about handling the notes client, its about customizing the mail6 template with domino designer). i will try to explain the WHOLE problematic:
first of all i want to add a button to the mail6 template.
this button should be seen by any user, that looks into his/her inbox. i will place the button next to the "forward" and "reply" buttons. i will name it "voice".
now, if some user selects a voicemail in his/her inbox and then clicks on my custom voice button, i would like to read his/her phone number from the address book and then forward the mail to his/her telephone (i have written a mailserver application that can do this).

i know how to do all of this, except how to get the selected mail object(the mailmessage the user selects, before he/she clicks on my custom voice button), so i can change the "To" address and forward it via my mailserver application to the telephone... (maybe this inbox view has some property that can return me the selected message)

ps.: sorry for my bad expression (i dont speak native english)
0
 
ArunkumarCommented:
oh okay...

Hopeyou have designer client with you.  On the server locate the StdR60Mail Template.

Open the database (A Template has .ntf extension) and on the left pane find the design elements.  Locate Folder and inside folders you will see ($InBox).  Double click to open this in designer client.  You will see the programmers pane at the bottom and the view design at the top.  Select from view menu - View - Action Bar.

This will open a new pane where you can see the buttons. Now this is the place you can add a new action button to your template.  Create - Action from the menu will allow you to do it.

Once you do it in the template it will be propagated to all the mailboxes overnight. You could also custom force design immediately by issuing console command.

Overall...touching the design of the template is risky. Make a backup before you start playing.

-Arun.
0
 
bekuAuthor Commented:
...adding the button to the template is not the problem, i also know how to "distribute" the template to all the clients with the "load design" console command.

the problem is how to automatically insert the "office phone number" of the address book entry into the "To" field of the message(the one the user selects before he/she presses the "voice" button i added) and then automatically forward it...

i know how to get the "office phone number" of the current user from the address book via lotus script(i wrote a small function that retrieves the "office phone number" of the current user).

but i dont know how to !automatically! alter the "To" field of the selected message and then send it (with attachments).
0
 
ArunkumarCommented:
Here is a raw code untested....

------------
Dim ss As New notessession
     Dim ws As New NotesUIWorkSpace
     Dim uidoc As NotesUIDocument
     Dim db As  NotesDatabase
     Set db = ss.Currentdatabase
     Dim dc As NotesDocumentCollection
     Dim doc As NotesDocument
     Dim rt As notesrichtextitem    
     Set dc = db.UnProcessedDocuments
     
     If dc.Count <> 1 Then
          Msgbox "Please select only one document to forward"
     Else
          Set doc = dc.GetFirstDocument          
          Set rt = doc.GetFirstItem("Body")
         
          Dim newdoc As NotesDocument
          Dim rt1 As NotesRichTextItem          
          Set newdoc = db.CreateDocument
          newdoc.Form = "Memo"
          Set rt1 = New NotesRichTextItem(newdoc, "Body")
          Call rt.AppendRTItem(rt1)
          newdoc.SendTo = "TESTING"          ' Change this TESTING to have your phone number.
          Set uidoc = ws.EditDocument(newdoc)              
     End If              
----------------------
0
 
bekuAuthor Commented:
ahhh i see!
seems like you are the real god of domino designer!
thx very much for your patience!
its a pity i only have 75 points... if i had more i would give them to u! you really deserve them!
adios!
0
 
ArunkumarCommented:
Did it work for you ?
0
 
bekuAuthor Commented:
i will test it tomorrow since i have too much to do today..
if it doesent work, i will write another comment...
0
 
bekuAuthor Commented:
hi arun,
im afraid, it didnt work...
the new form opens, but the sendto field is not replaced.
i tried to debug the script, and in the sendto property of the new document , the sendto field is filled with my phone number. strange isnt it?
another problem is, that the new form that opens, has no send button. even though i specified the form type as memo, it has the same buttons as the inbox...
i would also like the new memo to send itself automatically after the sendto field is filled in...
0
 
bekuAuthor Commented:
finally solved the problem:
Dim ss As New notessession
    Dim ws As New NotesUIWorkSpace
    Dim uidoc As NotesUIDocument
    Dim db As  NotesDatabase
    Set db = ss.Currentdatabase
    Dim dc As NotesDocumentCollection
    Dim doc As NotesDocument
    Dim rt As notesrichtextitem    
    Set dc = db.UnProcessedDocuments
   
    If dc.Count <> 1 Then
    Msgbox "Please select only one document to forward"
    Else
         Set doc = dc.GetFirstDocument          
         Set rt = doc.GetFirstItem("Body")
         
         Dim newdoc As NotesDocument
         Dim rt1 As NotesRichTextItem          
         Set newdoc = db.CreateDocument
         newdoc.Form = "Memo"
         Set rt1 = New NotesRichTextItem(newdoc, "Body")
         Call rt.AppendRTItem(rt1)
         newdoc.SendTo = "TESTING"'Change this TESTING    
         to have your phone number.
         Set uidoc = ws.EditDocument(newdoc)              
         uidoc.EditMode = True
         Call uidoc.FieldSetText("EnterSendTo", "TESTING")
     Calluidoc.Send                                             Call uidoc.Close
    End If              

0

Featured Post

Technology Partners: 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!

  • 6
  • 6
Tackle projects and never again get stuck behind a technical roadblock.
Join Now