Solved

How do I grab cell values in a Lotus Notes table?

Posted on 2006-06-29
9
275 Views
Last Modified: 2013-12-18
I have an email that I setup with a table and button from Lotus Notes. I want to be able to send it to people within my company so they can fill out the table. When they finish filling out the table they click the button and an email gets generated and sent right back to me. I want to be able to grab the data they entered into the table and pull into that email that gets sent back to me but I do not want the whole table. Example:

Table filled out by company employee where column 2 and 4 is the employee's data:

Column 1                Column 2                    Column 3                Column 4
Store A                   456                            Store C                    323
Store B                   542                            Store D                    186

This is what I want back:
456, 542, 323, 186

Is there a way to do that?
0
Comment
Question by:GCortesJr
  • 3
  • 2
  • 2
  • +1
9 Comments
 
LVL 46

Expert Comment

by:Sjef Bosman
Comment Utility
Yes, provided you send them a mail with a form, and they send you the form back as well. Design the form with the fields you need, then send it away with a doc.Send(True) or click Store form in document.
0
 
LVL 2

Accepted Solution

by:
TiwariVikas earned 400 total points
Comment Utility
No need of sending the form with mail...

We can achieve the same functionality using RichText Navigators....

Try the following code which I have customized according to ur need
This code will send back a mail with the data entered in the table.


Suppose you created a table in mail like this...
1a      2      3      4
5fdg      vikas       tiwari      8d
9      10sdf      11csdf      dsfsdf

and a Submit button with following code....

Sub Click(Source As Button)
      Dim session As New NotesSession
      Dim db As NotesDatabase
      Dim w As New NotesUIWorkspace       
      Dim doc As NotesDocument
      Dim uidoc As NotesUIDocument       
      Dim rtnav As NotesRichTextNavigator
      Dim rtRangeTable As NotesRichTextRange
      Dim rtNavTable As NotesRichTextNavigator
      Dim rtNavCell As NotesRichTextNavigator
      Dim rtRangeCell As NotesRichTextRange
      Dim rtRangePara As NotesRichTextRange
      Dim msg As String
      
      Set db = session.CurrentDatabase
      Set uidoc = w.CurrentDocument
      uidoc.EditMode = True
      uidoc.Save
      Set doc = uiDoc.Document
      If doc.TableFlag(0) = "" Then
            doc.TableFlag = "1"
            Call doc.Save(True,False)
            Set rti = doc.GetFirstItem("Body")
            Set rtnav = rti.CreateNavigator
            If Not rtnav.FindFirstElement(RTELEM_TYPE_TABLE) Then
                  Messagebox "Body item does not contain a table,",, _
                  "Error"
                  Exit Sub
            End If
            Dim rtt As NotesRichTextTable
            Set rtt = rtnav.GetElement
            Dim rtrange As NotesRichTextRange
            Set rtrange = rti.CreateRange
            Call rtnav.FindFirstElement(RTELEM_TYPE_TABLECELL)
            firstFlag = True
            StrValue = ""
            For i& = 1 To rtt.RowCount
                  For j& = 1 To rtt.ColumnCount
                        If Not firstFlag Then
                              Call rtnav.FindNextElement(RTELEM_TYPE_TABLECELL)
                        Else
                              firstFlag = False
                        End If
                        Call rtrange.SetBegin(rtnav)
                        StrValue = StrValue & Chr(10) &  "(" & Cstr(i&) & "," & Cstr(j&) & ")" & Cstr(rtrange.TextParagraph)
                  Next
            Next
            Set mdoc = New NotesDocument( db )
            mdoc.Form = "Memo"
            mdoc.SendTo = doc.From(0)
            mdoc.Subject = "Reply from " & session.CommonUserName
            Set rtBody = New NotesRichTextItem(mdoc, "Body")
            Call rtBody.AppendText("Here is the response from " & Cstr(session.CommonUserName ))
            Call rtBody.AddNewline (1)
            Call rtBody.AppendText(StrValue)
            Call mdoc.Send( False )
            Set nam = session.CreateName(doc.from(0))
            Msgbox "A notification mail has been sent back to " & nam.common
      Else
            Msgbox "You have already submitted the document."
      End If
      
End Sub

The mail returned will be....

Here is the response from Vikas Tiwari

(1,1)1a
(1,2)2
(1,3)3
(1,4)4
(2,1)5fdg
(2,2)vikas
(2,3)tiwari
(2,4)8d
(3,1)9
(3,2)10sdf
(3,3)11csdf
(3,4)dsfsdf

Please let me know if this code is able to solve your problem.

Regards,
Vikas.
0
 
LVL 18

Assisted Solution

by:marilyng
marilyng earned 50 total points
Comment Utility
Nicely done, vikas.. !  I was thinking that would be another way,  question, wouldn't you also need another agent to step through the response and convert it to the database?

for instance, (1,1) would have to convert to some fieldname, so when you process it in the receiving database, you would need an agent that would

1. collect "memo" or new entries mailed into the database (so you'd need to make the database a mail-in database)
2. Step through the body of each returned survey, and create a "new" document for this database using the values returned.
3. Mark the processed memo for archive, so it doesn't get processed again.
4. Add some key values to the sent form so you don't process it twice and create duplicates.
5. Add a check so that if the agent exits, or server is down and agent doesn't run, you have a way to step through your received surveys and check to be sure you have them all.

--------
Just a thought or two.. :)
0
 
LVL 46

Assisted Solution

by:Sjef Bosman
Sjef Bosman earned 50 total points
Comment Utility
Interesting, indeed! It would never be my tool in this case. Just to mention a few more drawbacks:
- no control over the "form" (add or remove columns and rows? Or even whole tables?)
- no visible fields
- no field calculations
- no field validations
- no processing by field
- NotesRichTextNavigator available only since R6, and rather buggy
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 18

Expert Comment

by:marilyng
Comment Utility
True, and then there's the part where the user edits the table in the email and adds a row...? It does seem like a lot of work to try and catch all the errors when you can simply send a form or a button that opens a form.
0
 
LVL 46

Expert Comment

by:Sjef Bosman
Comment Utility
Unless of course you don't have a Domino Designer for the form. Remains the question: how on earth am I going to create that wretched agent??
0
 

Author Comment

by:GCortesJr
Comment Utility
Just wanted to let everyone that I am trying out the solutions provided and will update this call soon. Thanks for all the good responses so far!
0
 

Author Comment

by:GCortesJr
Comment Utility
Sorry I didn't get back sooner to close this call out but the man has got me working hard lately. Anyways, TiwariVikas's code put me on the right track and got me real close to where I needed to go. marilyng & sjef_bosman gave me some food for thought for future planning. Thanks to all for the help.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

For Desktop Techs: How to retain a user's Notes configuration data when swapping out the end user's computer. (Assuming that you are not upgrading to a completely different version of Notes client) All you need to do is: 1) install Notes o…
Lack of Storage capacity is a common problem that exists in every field of life. Here we are taking the case of Lotus Notes Emails, as we all know that we are totally depend on e-communication i.e. Emails. This article is fully dedicated to resolvin…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

771 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

11 Experts available now in Live!

Get 1:1 Help Now