Question

Multiple embedded views on a form for Lotus Notes 7

Asked by: jenvin

I have a parent form and many responses in a lotus notes client application
The user needs to see details of the different types of responses in the parent form
What i originally did was to have 4 richtext fields and using lotus script inserted a table and printed the details of the response documents in all the 4 rich text fields. This code I ran at queryopen of the parent. This code prevented the parent from opening fast
I now have 4 embedded views to replace the 4 rich text fields on the parent form  Is this a better decision? Please ive me your thoughts

This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.

Subscribe now for full access to Experts Exchange and get

Instant Access to this Solution

  • Plus...
  • 30 Day FREE access, no risk, no obligation
  • Collaborate with the world's top tech experts
  • Unlimited access to our exclusive solution database
  • Never be left without tech help again

Subscribe Now

Asked On
2009-11-04 at 05:03:23ID24870689
Tags

multiple embedded views

Topics

Lotus Domino Email Server

,

Lotus Notes

Participating Experts
1
Points
500
Comments
31

Trusted by hundreds of thousands everyday for fast, accurate and reliable tech support.

  • "The time we save is the biggest benefit of Experts Exchange to Warner Bros. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange." Mike Kapnisakis, Warner Bros.
  • "Our team likes having a resource that is more secure than just using Google and most experts using this service really know their stuff. It's nice to look here first versus using Google." Dayna Sellner, Lockheed Martin
  • "Anytime that I've been stumped with a problem, 9 out of 10 times Experts Exchange has either the accepted solution or an open discussion of the potential solution to the problem." Kenny Red, eBay Inc.

See what Experts Exchange can do for you.

Got a question?

We've got the answer.

Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.

Screenshot of Experts Exchange Knowledgebase

Need individual assistance?

Our experts are ready to help.

If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.

Screenshot of Experts Exchange Knowledgebase

Want to learn from the best?

Read articles from industry experts.

Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.

Screenshot of an Article

Working on a long term project?

Store your work and research.

Save solutions to your questions, answers you’ve discovered through searching plus helpful articles in your personal knowledgebase for easy future access.

Screenshot of Experts Exchange Knowledgebase

Access the answers to your technology questions today.

Subscribe Now

30-day free trial. Register in 60 seconds.

What Makes Experts Exchange Unique?

Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Trusted by the world's most respected brands.

image of each brand's logo

Faithfully serving IT professionals since 1996.

Experts Exchange Logo

Try it out and discover for yourself.

Subscribe Now

30-day free trial. Register in 60 seconds.

Related Solutions

  1. Getting the name of the attachments in Lotus Script
    I have a richtext field in a form. When ever the user attaches documents in this field, I have to ensure that only the attachments in the form of zip or doc should be attached. For this purpose I have to get the name of the file attachment. In lotus script is there any way...
  2. Search and Replace in Richtext
    I want to have search and Replace for a Richtext field through Lotus Script. In webquery save i Even used @ReplaceSubstring and it is not Evaluating in LotusScript. Secondly if i am taking the Entire text from richtext field the String cannot store huge Text data in a string ...
  3. javascript with lotus domino -refer richtext field in subform
    hi i am working in lotus domino I have richtext field in subform which has button described in html and it is embedded in the main form. I want to disable this button by clicking the another button. how it can be done
  4. How to display richtext field image instantly on webpage usi…
    I'm trying to display a richtext field with images instantly into a webpage when a user select a specific catergory. Anyone has any idea how this can be achieved? My Development environment is in lotus note and web server is also lotus notes.

Free Tech Articles

  1. WARNING: 5 Reasons why you should NEVER fix a computer for free.
    It is in our nature to love the puzzle. We are obsessed. The lot of us. We love puzzles. We love the challenge. We thrive on finding the answer. We hate disarray. It bothers us deep in our soul. W...
  2. SCCM OSD Basic troubleshooting
    SCCM 2007 OSD is a fantastic way to deploy operating systems, however, like most things SCCM issues can sometimes be difficult to resolve due to the sheer volume of logs to sift through and the dispe...
  3. Migrate Small Business Server 2003 to Exchange 2010 and Windows 2008 R2
    This guide is intended to provide step by step instructions on how to migrate from Small Business Server 2003 to Windows 2008 R2 with Exchange 2010. For this migration to work you will need the fo...
  4. Create a Win7 Gadget
    This article shows you how to create a simple "Gadget" -- a sort of mini-application supported by Windows 7 and Vista. Gadgets can be dropped anywhere on the desktop to provide instant information, ...
  5. Outlook continually prompting for username and password
    There have been a lot of questions recently regarding Outlook prompting for a username and password whilst using Exchange 2007. There are a few reasons why this would happen and I will try to cover t...
  6. Backup Exchange 2010 Information Store using Windows Backup
    There seems to be quite a lot of confusion around the ability to backup Exchange 2010 using the built in Windows Backup feature. This stems from the omission of this feature prior to Exchange 2007 s...

Cloud Class Webinars

  1. Avoiding Bugs in Microsoft Access
    Alison Balter takes and in-depth look at avoiding bugs in Access. In this webinar you will learn about using the immediate window to debug your applications, invoking the debugger, using breakpoints to troubleshoot, stepping through code, setting the next statement to execute, ...
  2. Top 10 Best New Features in Visio 2010
    Scott Helmers gives live demonstrations of the top 10 new features in Visio 2010. This webinar will teach you how to create compelling diagrams by adding shapes to the page with a single click, linking the shapes in a diagram to data in Excel (or SQL Server, or SharePoint), ...
  3. IT Consultant Business Secrets Revealed
    Michael Munger, Experts Exchange tech pro and IT consultant, pulls back the curtain on his very successful businesses and answers question on every IT consultant and business owner should know about. He shares secrets on what he did to solve the 5 most common problems in IT, ...
  4. Disaster Recovery and Business Continuity
    Quest CTO, Mike Billon, gives an overview of the steps involved in building a dunamic disaster recovery plan. Through case studies and an examination of software/hardware tooles for monitoring and testing, you'll gain a better understandin of where you are, where you want ...
  5. Organize Your Visio Diagrams with Containers and Lists
    Scott Helmers uses cross functional flowcharts, wireframe diagrams, data graphic legends and seating charts to teach you: how to ustilize all three new structured diagram components in Visio 2010, the best practices for organizeing shapes in previous version of Visio, how to organize ...
  6. How to Us Objects, Properties, Events and Methods in Microsoft Access
    Alison Dalter gives an in-depbth look at objects, properties, events and methods in Microsoft Access. In this webinar you will learn about using the object browser, referring to objects, working with properties and methods, working with object variables, understanding the ...

Join the Community

Give a Little. Get a Lot.

Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.

Join the Community

Answers

 

by: mbonaciPosted on 2009-11-04 at 05:21:14ID: 25738982

You can put the code that fills your RTFs here so we can advise.

Have you tried the approach that would alter the parent doc upon closing response doc?

 

by: jenvinPosted on 2009-11-04 at 05:33:58ID: 25739076

What if the person who updates the response document does not have access to edit the parent document. Can this be taken care of? Also when another user has the parent document open , he will not be able to see the updates to the responses unless he closes and opens it again. If they are embedded views then the updates are visible immediately. Updating the rich text field in the parent queryopen that i was using is simple. Collecting the responses and writing a table to the rich text field with field values from the responses But this slows down the opening of the parent document. My woryy is using multiple embedded views

 

by: mbonaciPosted on 2009-11-04 at 05:49:07ID: 25739231

Do you always write the document tree to the RTFs or you first check whether something changed?

As far as modifying the doc to which an user doesn't have access to, it is done by using background agent (which has rights of the signer) to do it...

You can embed multiple views on a form, that may well be your best solution.
If you want to link those views to one another, in the "Single Click" target field on the Embedded View Properties box for the second view, enter the name of the first embedded view.

 

by: jenvinPosted on 2009-11-04 at 05:58:10ID: 25739312

"If you want to link those views to one another, in the "Single Click" target field on the Embedded View Properties box for the second view, enter the name of the first embedded view"

I did not understand this. Actually I have two sets of response documents. 2 embedded views need to lookup one type of response documents They need different columns to be displayed. As far as the other two embedded views are concerned they look up different response documents. If you can explain your comments i will see if it can help me. Has anybody tried using 4 embedded views?

 

by: mbonaciPosted on 2009-11-04 at 06:19:39ID: 25739475

To display a discussion thread in an embedded view from another embedded view, follow these steps:
 - Create an embedded view with threads on a page or form and assign it a name in the Embedded View Properties box.
 - Check the "Show only current threads" option on the Embedded View Properties box.
 - Create another embedded view on the page, form, or document.
 - In the "Single Click" target field on the Embedded View Properties box for the second view, enter the name of the first embedded view.

When a user opens the page or document, both views launch, displaying the current document and the associated thread. For an example of this, see the Notes 6.5 mail template.

 

by: jenvinPosted on 2009-11-04 at 09:27:14ID: 25741683

is it possible to show different columns of the same view in the two embedded views?

 

by: mbonaciPosted on 2009-11-05 at 01:53:38ID: 25747947

I don't think so, hide column formula would evaluate to the same result in both embedded views and, AFAIK, there's no way to get embedded view's name (assign in the embedded view's properties) from that formula.

 

by: jenvinPosted on 2009-11-05 at 02:31:54ID: 25748124

Thanks a lot for your inputs but i think i have found a good solution. I am planning to have a programmable table and when each tab is opened i am planning to populate a table in rich text field with the help of a cool database done by Andre Guirard where he is populating the rich text in ui. So when a tab opens I will be able to populate the rich text with the latest information and it seems to be pretty fast. You can check the Order forms  action Add Items action. I plan to run the code automatically for all rich text field Check out the article and give me your comments

http://www-10.lotus.com/ldd/bpmpblog.nsf/dx/dynamic-table-1?opendocument&comments

 

by: mbonaciPosted on 2009-11-05 at 02:53:51ID: 25748220

I tried copy and paste in UI and it will flicker the form and user will see the cursor switching fields and filling them.

Here's how to create and fill a table in background.
http://searchdomino.techtarget.com/tip/0,289483,sid4_gci1254682,00.html?track=NL-348&ad=593344&asrc=EM_NLT_1617329&uid=2188072

I still don't understand why it's so slow when you fill RTFs on parent's PO.
It should be pretty fast.

You should post your code, I'm sure we'll find something that would speed the things up...

 

by: jenvinPosted on 2009-11-05 at 03:20:35ID: 25748360

here is the cdoe

Dim ws As New NotesUIWorkspace
	Dim session As New NotesSession
	Dim db As NotesDatabase
	Dim uidoc As NotesUIDocument
	
	Dim AdDoc As NotesDocument 'original"base" document
	Dim ResDoc As NotesDocument 
	
'all the response documents
	Dim collCount As Integer
	Dim rowCount As Integer
	Dim columnCount As Integer
	Dim iRow As Integer
	Dim i As Integer
	Dim item As NotesItem
	Dim richStyle As NotesRichTextStyle
	
	Set db = session.CurrentDatabase
	Set uidoc = ws.CurrentDocument
	Set AdDoc = uidoc.Document 
	
	
	Dim body As New NotesRichTextItem(Addoc,"EUSAdders")
	
	Set richStyle = session.CreateRichTextStyle 
	
	
 'Now, we are going to get the collection of the response docs 
	Dim Collection As NotesDocumentCollection
	Set Collection = AdDoc.Responses
	
	collCount = Collection.Count
	rowCount = collCount 
	columnCount = 5 
	richStyle.FontSize = 8
	
	
	'
	
	Dim tableColStyles(1 To 5) As NotesRichTextParagraphStyle 'loop through this once for each column
	Dim styles As NotesRichTextParagraphStyle
	
	For i = 1 To columnCount Step 1
		Set tableColStyles(i) = session.CreateRichTextParagraphStyle 
' Create the rt paragraph style for this column
		tableColStyles(i).FirstLineLeftMargin = 0 
' Set left margin for the first line of each cell in column
		tableColStyles(i).LeftMargin = 0 
' Set left margin for all but the first line of each cell in column
		tableColStyles(i).RightMargin = RULER_ONE_INCH * 1
		tableColStyles(i).Alignment = ALIGN_CENTER 
' Centre the 2nd column. This is just to show that you can :
		Set styles = session.CreateRichTextParagraphStyle
		styles.Alignment = ALIGN_CENTER
	Next
	Call body.AppendTable( 1, columnCount%,,, tableColStyles) 
	
'1 row to start, rest will be added as needed.
'Now populate the table 
	Dim rtnav As NotesRichTextNavigator
	Set rtnav = body.CreateNavigator
	rtnav.FindFirstElement(RTELEM_TYPE_TABLE)
	Dim rtt As NotesRichTextTable
	Set rtt = rtnav.GetElement
	Call rtnav.FindFirstElement(RTELEM_TYPE_TABLECELL)  '1
	Call body.AppendParagraphStyle(styles)  
 'The first row is the headers
	richStyle.Bold=True
	Call body.AppendStyle(richStyle)
	'richStyle.NotesColor = COLOR_RED
	richStyle.NotesColor = COLOR_DARK_BLUE
	Call body.AppendStyle(richStyle)
	
	Call body.BeginInsert(rtnav)
	Call body.AppendText("Competency")
	Call body.EndInsert
	
	Call rtnav.FindNextElement(RTELEM_TYPE_TABLECELL) '2 
	Call body.BeginInsert(rtnav)
	Call body.AppendText("ServiceLine")
	Call body.EndInsert
	
	Call rtnav.FindNextElement(RTELEM_TYPE_TABLECELL) '3 
	Call body.BeginInsert(rtnav)
	Call body.AppendText("ServiceLineComponent")
	Call body.EndInsert
	
	Call rtnav.FindNextElement(RTELEM_TYPE_TABLECELL) '4
	Call body.BeginInsert(rtnav)
	Call body.AppendText("Activities / Process ")
	Call body.EndInsert
	
	Call rtnav.FindNextElement(RTELEM_TYPE_TABLECELL) '5
	Call body.BeginInsert(rtnav)
	Call body.AppendText("India Approved EUS FTE")
	Call body.EndInsert
	
	Call rtnav.FindNextElement(RTELEM_TYPE_TABLECELL)
 'next row
 'Now add in data from the response documents selected
	richStyle.Bold=False
	Call body.AppendStyle(richStyle)
	'richStyle.NotesColor = COLOR_RED
	richStyle.NotesColor = COLOR_Black
	Call body.AppendStyle(richStyle)
	For iRow = 1 To rowCount Step 1
		Msgbox iRow
		Set ResDoc = Collection.GetNthDocument(Cint(iRow))
		
		Call rtt.AddRow(1) 
		
		Call rtnav.FindNextElement(RTELEM_TYPE_TABLECELL) 		
		Call body.BeginInsert(rtnav)	
		'Call body.AppendText(ResDoc.Competency(0))	
		Call body.AppendText(ResDoc.Competency(0))	
		Call body.EndInsert
		
		Call rtnav.FindNextElement(RTELEM_TYPE_TABLECELL) 
		Call body.BeginInsert(rtnav)	
		Call body.AppendText(ResDoc.ServiceLine(0))
		Call body.EndInsert
		
		Call rtnav.FindNextElement(RTELEM_TYPE_TABLECELL) 
		Call body.BeginInsert(rtnav)	
		Call body.AppendText(ResDoc.ServiceLineCompetency(0))
		Call body.EndInsert
		
		Call rtnav.FindNextElement(RTELEM_TYPE_TABLECELL) 
		Call body.BeginInsert(rtnav)	
		Call body.AppendText(ResDoc.ActProcess(0))
		Call body.EndInsert
		
		Call rtnav.FindNextElement(RTELEM_TYPE_TABLECELL) 
		Call body.BeginInsert(rtnav)	
		Call body.AppendText(ResDoc.IndiaAppFTE(0))
		Call body.EndInsert
		
		Call rtnav.FindNextElement(RTELEM_TYPE_TABLECELL) 
		
	Next 
	
	
	Call Addoc.Save(True,False)
	Call uidoc.Close
	Call ws.EditDocument(True,Addoc)

                                              
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:
128:
129:
130:
131:
132:
133:
134:
135:
136:
137:
138:
139:
140:
141:
142:
143:
144:
145:

Select allOpen in new window

 

by: mbonaciPosted on 2009-11-05 at 05:05:15ID: 25748954

A few tips to speed things up:

 - to avoid closing and opening the doc transfer the code from PostOpen event to QueryOpen (you'll needs minimal corrections)
 - collection.getFirstDocument and getNextDocument are way faster then collection.GetNthDocument
 - don't do the whole thing every time you open the doc:
        - use e.g. environment var or (profile) doc to store a flag (with parent ID) whether you need to update the table as a whole
        - you can store the list of document IDs (unid, noteID, your id) that are changed in an environment var
        - then in parent's QO event, get the list of response IDs and check whether they are in your list

 - do everything you can before opening the parent doc:
        - transfer the code to Script Library (and just call it from the doc) so you can initialize your styles (declared as lib's global vars) in lib's Initialize event
        - use separate style for each component to avoid changing style properties (prepare all different styles you'll need in your lib and then just apply them in QO)

 - you don't need collCount and rowCount if collCount = rowCount (this, by itself, is so minute period of time that it cannot even be counted as a waste, but still...)
 - instead of creating table every time, try to alter existing one, to avoid loosing time on styles, etc...

For the last advice, I'm not sure whether it's faster to do the whole thing or to search through table using rtNav.
But in combination with not processing all responses (only the flagged ones) and with not creating a header each time, I'm sure it's faster.

You can test whether searching and altering the table is faster then creating one from scratch on a simple example using Timer() function to measure duration of each code.

 

by: jenvinPosted on 2009-11-05 at 05:11:04ID: 25748994

I will implement all the changes that you suggested but how do we track if the response document has been modified or not ?

 

by: jenvinPosted on 2009-11-05 at 05:15:38ID: 25749033

Also if you have a sample of doing this , it will be very helpful. I am troubling you a lot but I have a deadline for this that is fast approaching

 

by: mbonaciPosted on 2009-11-05 at 05:16:32ID: 25749041

If it's modified manually, just append its noteID to environment var in QueryClose (if doc is <changed> and if noteID isn't already in environment var).
If it's modified by background process you'll have to alter the processes to do the same thing.

I don't know what are your criteria of <changed> doc, in other words, when you need to alter the parent.

 

by: mbonaciPosted on 2009-11-05 at 05:17:24ID: 25749050

I don't have a sample, sorry.

Start and ask when you get stuck...

 

by: mbonaciPosted on 2009-11-05 at 05:18:16ID: 25749059

And make it 500, instead of 125.
I've already invested much more here :)

 

by: jenvinPosted on 2009-11-05 at 05:39:06ID: 25749260

Thanks will have to check how to store the modified responses

 

by: mbonaciPosted on 2009-11-05 at 08:29:37ID: 25751126

What do you mean "how to store modified responses"?
To store in parent or you want to flag modified ones?

Maybe you can explain when do you say your response doc is modified (isSaved or you check some fields).

 

by: jenvinPosted on 2009-11-05 at 21:53:38ID: 25756874

This is what i have thought about this
As you know I have a parent and many response documents.
There are about 5 tables that I have to generate when any user user opens the parent and all this information has to come from the responses. This information has to be the latest.

Everybody who has access to write to the response may not have write access to the parent and so this update wil have to be done by an agent. If in case the parent is being edited by someone else and the the agent tries to update the parent there s a conflict

I thought about the 5 embedded views that will show the latest response information  but I am not very comfortable with having 5 embedded views in the form since the embedded views will be slow to load once the database grows in size

If i think about updating the parent in the queryopen event like we discussed before ,(fetching information from response and populating the 5 rich text fields) opening the parent will be slow which i am not very happy about

I thought of having programmable table and when the user clicks the tab i can fetch the latest details into the rich text field using an agent. But for this to work the user needs to have write access to the parent which may not always be the case

So finally I am thinking of a soluiton where in there is one separate response document to the parent which is not visible to anybody (and so will not be edited) and this has the 5 tables in 5 rich text fields. These 5 rich text fields are updated with information everytime a response is saved. This save is done using an agent and so if there are two responses being saved at the same time the two instances of the agent will run one after the other and the updates from both the responses will be pushed to the rich text fields. When the parent is opened, a agent is run to append the 5 rich text fields from the response (which has the 5 rich text field and is hidden from all users ) to the parent and this will be quick because there is not much to be done . The rich text fields  from the response will just have to be appended to the ones on the parent document

Please let me know if this is a good solution. The only drawback is that the information in the parent will be  the latest that is  available from the responses at the time the parent was opened. If there was any change done to the response after the parent was opened , it will not be visible. To get the latest information the parent will have to be reopened

 

by: mbonaciPosted on 2009-11-06 at 00:51:19ID: 25757600

That's not a bad idea at all :)
Still, I'd suggest that you implement changes we talked about into your existing code.
Then, we'll see how fast/slow it is. Maybe you wont have to use your "hidden response" approach, after all.
If it turns out the you need to use HR approach, you'll use the same, optimized code.

One thing with the agent.
In order for agent to have signer's access rights it has to be scheduled.

If an user runs the agent (e.g. from forms QC event), the agent will inherit that user's access rights, so it wont work. It has to be scheduled and I think the minimum period is 5 minutes.

I use the agent approach for the same reason in my application.
I created a folder to which I add documents (that contain field names and field values to be changed).
Agent runs every 5 minutes, gets the folder, processes documents and removes them from the folder (or deletes them if you don't need change history).

One question, how do you change the parent doc now, if a user has only read access to it?

 

by: mbonaciPosted on 2009-11-06 at 01:02:34ID: 25757649

One more thing,
it doesn't matter how many documents a db has if your embedded views are restricted by "show single category" option.

In order to always have all your views built so that users (and your embedded views) don't have to wait, no matter which view they decide to open, you should create a Program document:

Open names.nsf > Configurations > Servers > Programs > Add Program

Program name:
     updall
Command line:
     "SubfolderOfData\Production\db.nsf" -C

Set other fields similar to this:
Enabled/disabled:
     Enabled
Run at times:      
     02:00 each day
Repeat interval of:      
     0 minutes
Days of week:      
     Sun, Mon, Tue, Wed, Thu, Fri, Sat


-C option means that Update (indexer) task will update indexes of all unused views (that means that all other view indexes are built because they are used).

There's no more waiting for my users since I added this to production server. This means your form wont have to wait for your embedded views are built.

 

by: jenvinPosted on 2009-11-06 at 01:27:34ID: 25757740

I felt much better after you approved my design. I have been thinking about all this for the past two days.

To update a parent when the user has only read access can i not have a queryopen agent that will do the job of appending the richtext fields? I am not sure.Please advice
Also html tables will look neater than embedded views Right? I will be giving a button next to each row to open the response document in a dialog box (Any sample that you think is nice?) If i choose to have a couple of embedded views I will take your advice on the updall.
Thanks for your support. You deserve every of the 500 points! I am going to start work on the new design right away!

 

by: mbonaciPosted on 2009-11-06 at 02:50:40ID: 25758035

Correction, if agent is called like this:
     agent.runonserver

then it has signer access rights.

This is the only way to trigger an agent so that it runs with signer's (last saver) access rights.

 

by: jenvinPosted on 2009-11-06 at 03:08:20ID: 25758122

Thanks  Let me start with my code . Will I be able to still contact you if I close this using 'Accept as Solution" or do I have to wait for a couple of days?

 

by: mbonaciPosted on 2009-11-06 at 03:11:30ID: 25758136

No need for closing it right now...
You'll close it when you finish your code and preferably post it here, to help the others.

 

by: jenvinPosted on 2009-11-07 at 04:31:19ID: 25766026

I am stuck with initializing the rich text style as you said. Have not been able to achieve adding a stylesheet for richtext. Please help

 

by: mbonaciPosted on 2009-11-09 at 01:01:52ID: 25774306

In Script Library:
Options:
      Option Public
      Option Declare

Declarations:
      Dim s As NotesSession
      Dim richStyleNormal As NotesRichTextStyle
      Dim richStyleBold As NotesRichTextStyle
      
      
Initialize:
      Set s = New NotesSession
      Set richStyleNormal = s.CreateRichTextStyle
      Set richStyleBold = s.CreateRichTextStyle
      

In Form's QueryOpen:
      ...
      Call body.AppendStyle(richStyleBold)
      ...

 

by: jenvinPosted on 2009-11-09 at 01:12:52ID: 25774377

Is there a problem if i use the Notes Stream Class to write the content to the rich text field as HTML?

 

by: mbonaciPosted on 2009-11-09 at 02:07:49ID: 25774603

Not at all.

Example:

Sub Initialize
	Dim session As New NotesSession
	Dim db As NotesDatabase
	Dim doc As NotesDocument
	Dim body As NotesMimeEntity
	Dim stream As NotesStream
	Dim row As Integer
	Dim column As Integer
	Dim prompt As String
	Dim recipients As String 
	session.ConvertMime = False 
	Set db = session.CurrentDatabase
	Set doc = db.CreateDocument
	Call doc.ReplaceItemValue("Form", "Memo")
	Call doc.ReplaceItemValue("Subject", "Doc created " & Format$(Now, "dd mmm yyyy hh:nn:ss AM/PM")) 
	Set body = doc.CreateMIMEEntity("Body")
	Set stream = session.CreateStream
	Call stream.WriteText({<table border="1" width="500" align="center">}) 
	For row = 1 To 4
		Call stream.WriteText("<tr>")
		For column = 1 To 4
			Call stream.WriteText({<td width="25%">})
			Call stream.WriteText("Row " & Cstr(row))
			Call stream.WriteText(", Column " & Cstr(column))
			Call stream.WriteText("</td>")
		Next
		Call stream.WriteText("</tr>")
	Next 
	Call stream.WriteText({</table><br />})
	Call body.SetContentFromText(stream, "text/html", ENC_QUOTED_PRINTABLE)
	Call stream.Truncate 
	prompt = "Enter the recipients for this memo. Separate multiple values with a comma"
	recipients = Inputbox(prompt, "Enter Recipients") 
	If recipients = "" Then
		Msgbox "You did not enter any recipients. Message not sent.", 16, "Not Sent"
	Else
		Call doc.Send(False, Split(recipients, ","))
	End If 
	session.ConvertMime = True
End Sub

                                              
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:

Select allOpen in new window

 

by: jenvinPosted on 2009-12-30 at 23:34:53ID: 26152209

Hello mbonaci
Thanks a ton for all the help that you gave me for this issue. The project is not yet over but I thought it was high time to close this.

 

by: jenvinPosted on 2009-12-30 at 23:36:25ID: 31649953

I have used Notes Stream class to do all the coputations. Will show you the sample as soon as it is complete. Thanks again

20120131-EE-VQP-002

3 Ways to Join

30-Day Free Trial

The Experts

98% positive feedback on 31,087 answers since March 2000. angeliii is a Microsoft Most Valuable Professional for his work with MS SQL Server & Develoment.

He has also proven his knowledge of Visual Basic Programming, PHP Scripting and Oracle Databases.

The Experts

97% positive feedback on 10,752 answers since July 2000. lrmoore has more than 18 years experience in the networking industry.

The six-time Mircosoft MVPs specialties include firewalls, virtual private networking, and network management.

Testimonials

"...and excellent source for support... Kind of like having your very own IT dept." Electriciansnet

Testimonials

"I was apprehensive at signing up at first. However... it has already made my life as an IT administrator much easier." JaCrews

Testimonials

"WOW! You guys have great, active, and knowledgeable people on here." moore50

Business Clients

Business Clients

In the Press

"If you’ve got a question... Experts Exchange can supply an answer.”

In the Press

"...an invaluable aid for both IT professionals and those who require tech support."

In the Press

"where IT professionals provide quick answers on just about any topic"

Business Account Plans

Loading Advertisement...