Solved

Lotus Notes - disable word wrap in preview pane and when viewing message.

Posted on 2006-11-16
41
4,878 Views
Last Modified: 2013-12-18
I am building a formatted text report and emailing it to recipients who use Lotus Notes 6.5. The report consists of text that is formatted into several columns and the entire report can be rather wide at times.  When users view it in Lotus Notes, the lines of the report are word-wrapped so it is no longer legible.  Is there a way to turn off word wrap in Notes in both the preview pane and the message viewing window?  I would like the Notes users to scroll left or right to view the hidden or "clipped" parts of the report. Thanks.
0
Comment
Question by:glentek
  • 12
  • 10
  • 7
  • +6
41 Comments
 
LVL 2

Expert Comment

by:hong7cong
ID: 17962175
I think to control how the formated text showed in our screens is rather complicated because it depends on so many factors (is your text editor/email system same as recipients - Lotus Notes, the screen resolution used by you and the receipients). So, instead of trying to ensure that your screen is fitted to others' screen, I think we just use a standard report format and send as attachment.
0
 

Expert Comment

by:LordMacBee
ID: 17963159
Are you packing this data all in a RTF field programmatically?

if yes, your options are rather scrase: It might be possible to dynamically create tables with fixed width and height which would disable any clipping or word wrapping effects. I havent checked this, might be worth a look at.

If the information in the report is well structured, consider creating a form for it by using fields within tables (in which case you can restric the look and feel of the table). The send the report to the user by mail attaching the form (there's an option to do this in case you dont already know).
This way the preview should look okay.

But probaly you're adding data dynamically into a number of columns c and a number of rows r. both r and c are unknown and vary.
In that case i would strongly recommend exporting the data into tabular text or excel format, save it as file and then attach it to the mail you send (this is pretty much what hong7cong suggested). But this solution only makes sense if the recipients do not have to edit the data and it is only delivered for viewing purposes.

Come to think of it: Depending on how often you do this and on the volume of the data it would make sense to create the report in a nice structured file as descibed above, attach this file to a document repsitory and just send the users the link to the document. That would be the cleanest soulution imho.

Generally, trying to squeeze data into rtf fields and hoping it looks okay seldomly works out. And it often looks pretty crappy =) it's notes after all.

If you need more info on how to implement one of the described solutions let me know and please provide some more details about these reports. What they contain, who has to do what with them, where are they stored and from what data are they derived.
0
 
LVL 63

Expert Comment

by:SysExpert
ID: 17965083
I agree that it is probably best to use an attachment, and have the user simply choose the view option to see it.

I hope this helps !
0
 

Author Comment

by:glentek
ID: 17966181
More info.  This email is being constructed in a VB script using CDO (Collaboration Data Objects).  There is no Notes software being used to construct the email.  The recipients are viewing using Notes 6.5.  Discuss...
0
 
LVL 63

Expert Comment

by:SysExpert
ID: 17967479
Well it should be simple enough to change the VB to do an attachment of a doc rather than put the data in the body.

can you post relevant code. just the notes related sections creating the email ?

I hope this helps !

0
 

Expert Comment

by:LordMacBee
ID: 17967501
export it to a file in VB. Remotely create and attach the file to a notes database. Send notifications of new report to the users. done
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 17968733
Would it be an idea to create a PDF-file??
0
 

Expert Comment

by:LordMacBee
ID: 17968758
it would.. depending on what needs to be done with the data you want to write into the report.

As I said, put the data into a feasible format, attach it to a notes document in a database, send users the link to it.
Yo avoid ugly presentation of the data and too much bandwith use by sending out identical reports
0
 
LVL 18

Expert Comment

by:marilyng
ID: 17969675
Did you try sending it with HTML tags?
0
 

Author Comment

by:glentek
ID: 17969706
I want the solution exactly as originally stated.  I want the message to be viewable and correctly formatted in the Notes preview pane and in any other Notes window.  I don't think an attachment is what I want.
0
 

Expert Comment

by:LordMacBee
ID: 17969733
right, in that case could you kindly provide us with a screenshot of how it looks now? I want to see what we're talking about...
0
 
LVL 18

Expert Comment

by:marilyng
ID: 17970387
Offhand, the only way you can do this without sending an attachment, or image of the report is to attempt to send as html with fixed table and column widths.  

Quick and dirty way?  Open MS Word, change the page layout to landscape or whatever size you want.

Create a table with your columns and rows, and before you add any information, open the table properties and FIX the table width, FIX the column widths, that is make the table width = 10" (inches), and each of the columns 3.32" (inches).  Fill in whatever data you want, and from the Word Menu select File>>Send to Mail Recipient.  

I sent my test report from Word/Outlook via POP3 to my Notes Client.. One large table, had to scroll to see the "right" side of the report.  (and I have a 20" monitor)

See if that works for you. (ah, if it does, then you can export the HTML and copy the table HTML tags)
0
 
LVL 9

Expert Comment

by:Lieven Embrechts
ID: 17971482
Maybe you can create an agent that changes what you want when a mail comes in from that specific source.
0
 
LVL 8

Expert Comment

by:behenderson
ID: 17972459
'I am using RichText as the name of my RichTextItem you may be using another variable name change the code accordingly

Dim rtpStyle As NotesrichTextParagraphStyle
Set rtpStyle = session.CreateRichTextParagraphStyle
rtpStyle.Alignment = 4  ' 4 = NoWRAP
Call richText.AppendParagraphStyle(rtpStyle)
0
 
LVL 18

Expert Comment

by:marilyng
ID: 17972752
Uh, behenderson, you are misunderstanding the problem at hand here:

>>The report consists of text that is formatted into several columns<<

I am assuming for the text to wrap badly so that it is unreadable, it looks like this when sent:


column1                              column2                  column3
line1                                   line2                        line3


But when it arrives it looks like this:

column1                column2
column3                line3
line1                     line2


Setting a rich Text paragraph style to no wrap  may do the trick for the horizontal wrapping, but it may not keep the columns in place.  

Of course, I am assuming the report is being generated either outside or inside of notes... as a plain text report, an excel report or something similar.  dunno.

Inside of Notes, the ONLY way to get columns of information to wrap correctly within a column is to present them in a table, even then, because of variable fonts, even tabs won't align correctly unless you use a fixed font like courier and start parsing each row, so that each line break is a specific number cpi and then both the rows and columns will align correctly without tables.

To do THAT you need to break the report down to arrays: (and because this forum uses a variable width font, even these won't line up correctly)

column1                      column2                      column3
line1..................        matchline1........            matchline1.............
line1..................
line1.................
line2................          matchline2........            matchline2............

If you just put a no wrap on the text,  I think you will get:

column1                     column2                       column3
line1..............................................................................
line1.............................................................................
matchline1col2..........................matchline1col3..........................................
Line2..................matchline2 ....... and so on.

Did you try mailing your solution?  :)        
0
 
LVL 8

Expert Comment

by:behenderson
ID: 17973695
Well the mail handler on your machine is most likely going to have an impact on the process.  Microsoft mail wraps by default.  If you look in the Internet options in Internet Explorer it will show you what program you are using for mail.  You need to make sure that this program is not going to Wrap Lines when it does it's MIME Encoding.  It is not real intuitive to get Microsoft mail to not wrap this is a documented problem.  VB does not just pop the mail out.  It uses the default mail handler for the machine to handle mail. See Q250558  at the microsoft site.

On the Internet Mail tab of the Internet Mail Service properties, you can click Message Content to send attachments by using MIME or uuencode. If you select MIME to send attachments, in the Advanced options dialog box, under Message text word wrap, Never is selected by default. The value in the At column box is also set to 76 by default, and is unavailable (dimmed).

To ignore the default word wrapping for MIME attachments, click At column, and then reselect Never.

The value in the At column box is changed to "0". If this value is set to "0", the default word wrapping for MIME attachments is ignored.
0
 
LVL 18

Expert Comment

by:marilyng
ID: 17975141
Interesting, but I think we're both guessing here.   I sent my test using Microsoft Word through OUTLOOK/POP and Exchange to Notes, and then again, creating in Notes and sending through Notes.  I did not change any special settings to achive a non-column wrap in Notes.  

Again, we really don't know how the report is being generated or sent.  We need more information from glentek,  I think.
0
 

Expert Comment

by:LordMacBee
ID: 17975269
roger that =)

screenie and / or code please
0
 

Author Comment

by:glentek
ID: 17975799
marilynq's decription of her understanding of the problem is correct (2 posts ago).  So there's your virtual screenie.

marilyq:  how many column's did you create in your test message.  Create a *lot* of them.

My message is put in BodyText propertys of a CDO message.
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 18

Expert Comment

by:marilyng
ID: 17976299
My message was 14" wide, I think number of columns isn't the issue here.   Its how the message is being created.   If you are just creating plain text and expecting tabs  and nowrap to work, it won't, not ever.   The receiving mail system will adjust both the font, and wrapping of ANY plain text message in the Body of an e-mail.

Your choices are simple:

1. Send as HTML with fixed table/column widths and courier font embedded css styles - MS word will do this for you without sweating.
2. Send as an image embedded in the body of the e-mail.
3. Send as an attachment. (rtf or PDF)
0
 
LVL 8

Expert Comment

by:behenderson
ID: 17976709
Before you dismissed the possibility that the default mail handler on your local machine (That's the one that will pop up when you click on a mailto href) controls what the format of an outgoing message looks like, did you test it?  Unless your exchange server is somehow set to overwrite it you have the ability to change the format of your outgoing messages.  In Options under Send or Mail Format (It depends on your mail handling software) you should be able to set it to your specifications.  You may have a limitation of 132 Characters under Plain Text Wrap setting, but this is what is going to control your outgoing mail format.  If you want to use an HTML option then you will need to set HTML as the outgoing messaging format and then write your code accordingly.  If you want to send it as plain text then set that up the way you want it to go out as well.  But by the time Notes Receives it any encoding has already taken place.

If you look at your options in your default mail handler software, and you do not like those options or they do not work for you then you are going to have to come up with another solution.  Because the way you encode your outgoing message is the way that you encode it, and that controls how it looks when others receive it.

There is a simple way to see if this controls the mail format.  Write a test memo and include the line of numbers below.  Open your default mail client.  Go into Options.  Find the spot that sets HTML Or Plain Text.  Change it to Plain Text.  Adjust the Lines to wrap at.  Send a test message to a Notes User.  Adjust the lines again.  Then send a copy of the same message.  If your email client is controling the outoing mail format then they will look different.  If you set your outgoing mail client to use HTML but you do not create an HTML memo then the default word wrap lenth for microsoft will apply.

123456789012344567890123456789012344567890123456789012344567890123456789012344567890123456789012344567890123456789012344567890

If you are going to send HTML with CDO you put the contents in .HTMLBody and not .TextBody and you need to include all the HTML tags in it <HTML><BODY> ... </BODY></HTML>  It will also probably show up as an attachment in most peoples email.
0
 
LVL 18

Expert Comment

by:marilyng
ID: 17977144
I believe, and can be wrong,  since the CDO's parameter objNewMail.MailFormat is set to CdoMailFormatText  (uninterrupted plain text ) by default, the text wrapping is executed on a client's side (for example, in MS Outlook, Eudora).

I assume the cdo script is being executed by .asp or exchange server or in some environment where the e-mail is being configured programmatically.  If this is true, then the server is compiling and encoding the e-mail, similar to any html email newsletter or marketing message that we receive daily.

Now, I assume that some variation of CDO is employed sending html email newsletters using MIME encoding, and that the e-mail message code looks something like this: (from: http://www.paulsadowski.com/WSH/cdo.htm#LoadFromFile)
Function GetData()
Dim x, strTemp, objExcel, objWB

Set objExcel = Wscript.CreateObject("Excel.Application")
Set objWB = objExcel.Workbooks.Open("c:\Acme Inc\Workbooks\Test.xls")
Set objSheet = objExcel.ActiveWorkbook.Worksheets(1)

' Make Excel visible while debugging
objExcel.Visible = True

' This is the row of our first cell.
x = 1

do while objExcel.Cells(x, 1).Value <> ""
  strTemp = strTemp & objExcel.Cells(x, 1).Value & _
    Space(10 - Len(objExcel.Cells(x, 1).Value))
  strTemp = strTemp & objExcel.Cells(x, 2).Value & _
    Space(50 - Len(objExcel.Cells(x, 2).Value))
  strTemp = strTemp & objExcel.Cells(x, 3).Value & vbCRLF
  x = x + 1
loop

' This will prevent Excel from prompting us to save the workbook.
objExcel.ActiveWorkbook.Saved = True

' Close the workbook and exit the application.
objWB.Close
objExcel.Quit

set objWB = Nothing
set objExcel = Nothing

GetData = strTemp
End Function

' This is our main function.
Dim strBody

Set objMessage = CreateObject("CDO.Message")
objMessage.Subject = "Inventory report for " & Date
objMessage.From = "me@my.com"
objMessage.To = "bossman@my.com"
strBody = "Part" & Space(6) & "Item" & Space(46) & "Stock" & vbCRLF

' Here we call the function GetData to populate the body text.
strBody = strBody & GetData

objMessage.TextBody = strBody   <<<sending as plain text
objMessage.Send

-----------------
The above code produces this:

To: bossman@my.com
From: me@my.com
Subject: Inventory report for 3/19/2005

Part      Item                                              Stock
4583586   Fliggalhopper                                     452
5898547   Looplonger                                        293
------------------------------------------------------------------
and this will wrap as soon as the mail client decodes the message.

bHenderson is correct with regard to sending using .htmlbody: (more examples from the above link)

'The line below shows how to send using HTML included directly in your script
objMessage.HTMLBody = "<h1>This is some sample message html.</h1>"

'The line below shows how to send a webpage from a remote site
'objMessage.CreateMHTMLBody "http://www.paulsadowski.com/wsh/"

'The line below shows how to send a webpage from a file on your machine
'objMessage.CreateMHTMLBody "file://c|/temp/test.htm"

-----------------------------

Other helpful links and examples:
http://www.paulsadowski.com/WSH/cdo.htm#LoadFromFile
http://www.15seconds.com/Issue/980429.htm
http://support.microsoft.com/?kbid=278321

----------------------------------------------
However, even the best code can be thwarted by the e-mail server, which is normally why we put: "Click here if you are unable to read this html e-mail" at the top of web page emails, or attach a PDF of the html body for those places where HTML is blocked, or turned into garbage.

The Notes server and client is rather famous for botching html email, and the more successfully rendered pages are generally those with nested, fixed tables.  (although I must admit, the 6.5.5 + clients do a much better job of it)

Other problems include the person document mail format settings: "prefers MIME"  will almost always render the html to an attachment, while: "Keep in senders format" does a better job of rendering HTML emails.  Incorrect Proxy settings in the location document deliver email with red boxes instead of images, and so on.

'nuff..!


0
 

Author Comment

by:glentek
ID: 17984331
I put the report between 'pre' tags in htmlBody, along with an embedded long skinny .gif file.  The .gif caused the horizontal scrollbar to appear in the Notes message viewer and preview pane.  However, the report was still messed up by word wrap at what appeared to be about the 125th character position.  In the Notes viewer, I selected the report and copied/pasted into notepad.  The report looked perfect in notepad, which leads me to believe the mail handler on the source machine is not doing the word wrap.  I think it's the Notes application.
0
 

Author Comment

by:glentek
ID: 17984336
BTW - This Notes client 6.5.5.
0
 
LVL 18

Expert Comment

by:marilyng
ID: 17984460
glentek, can you post your code?   I think the long skinny .gif is not going to do it if you're sending the rest of the report plain text and not contained in tables and columns with fixed sizes.

I'm running 6.5.5 and 7.01
0
 

Author Comment

by:glentek
ID: 18013012
I organized the data into an HTML table and used CDO message htmlBody.  I specified fixed widths in the cells.  I did not use a style sheet.  I played with it a while and found that specifying the width in the cells did change the appearance of the table when viewing the email in Notes.  The columns were wider when the width was set to 200 than when it was set to 100.  However, if the number of columns was too great, Notes hit the wall and would not let the table grow in width.  It started making columns narrower and wrapping data within each cell.

marilynq - how many columns did you create in your email?
0
 
LVL 18

Expert Comment

by:marilyng
ID: 18013231
hmm, 20 columns about 1 inch each.  

However, I opened notes, created a new memo and put a table on the memo, displayed the ruler (now, remember the default margin for the notes memo is 1") and it looks like 22" is the maximum width (that is on MY display - 20"), that is, the scroll bar works up to 22" then the rest of the table is off the screen.

How many columns are you sending?  Offhand, and since I've never had to send large tables in the body of an email, since they pose printing problems, it would seem there is a horizontal limit.  Can't say for sure, since I've never run into it before.  
0
 

Author Comment

by:glentek
ID: 18022256
I tried this.  I made the first row of the html table a long skinny .gif.  I made the subsequent rows contain the report data.  Well, after receiving the email, Notes showed nothing in the preview pane or viewing window.  However, he horizontal scrollbar was shown, so I figured something was there.  I selected/all/cut from Notes message viewing window, and pasted into a text editor.  Guess what?  The contents of the report showed up in the text editor, even though Notes did not show anything.

I'm growing less impressed with Notes by the minute.  It doesn't seem to display html data properly...

0
 

Expert Comment

by:LordMacBee
ID: 18022299
you're right on that one. It's not Notes' strong side. There might be another way to do this.
if could try to create and embedded excel worksheet object in the memo and specify it's size to be as wide as you need it. Now I havent tried this so I wouldn't know how it looks or if it even displayed anything usefull in the preview pane.
Of course you would have to remotely fill the embedded object for wherever you pull the data from.

0
 

Author Comment

by:glentek
ID: 18024163
I found the workaround I need, although it was not what I was originally looking for.

First, the things that failed:
1. Embedding a long thin image in the email. Body of message still wrapped when Notes "felt" like it.
2. Using HTML fixed width table.  Notes did not display report properly, especially when many columns were displayed. It appeared Notes ignored the "width=" specification.
3. Using HTML fixed column cells.  Notes displayed report properly until too many columns caused it to hit the wall.  At that point columns became thinner, data was wrapped within cells causing report to be unreadable.

The think that worked: Creating an HTML table with 1 column and 2 rows.  In the first row I created an inner table with fixed-width cells that contained the report data.  In the second row I put a long, thin embedded image.  I had to make sure the image was wide enough to handle the maximum number of anticipated report columns.

So marilynq gets most of the points. I'll give some to LordMacBee and behenderson too.  Thanks.
0
 

Expert Comment

by:LordMacBee
ID: 18025704
good stuff .. now can we see a screenie?  =)))
0
 

Author Comment

by:glentek
ID: 18115409
My final workaround:

Creating an HTML table with 1 column and 2 rows.  In the first row I created an inner table with fixed-width cells that contained the report data.  In the second row I created another single row table that contained the same number of columns as the table that contined the report data.  In each of these cells I put a thin image whose width was the number of pixels that was specified in the column width of the report data.

0
 

Author Comment

by:glentek
ID: 18333294
I provided the workaround (see "My final workaround:" above).  I want that to be the "accepted answer.  I appreciate the contributions marilynq and behenderson made.  I want the points split:

marilynq - 400,  

behenderson - 100.

Thanks.
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 18333467
You can do that yourself. Click on Split, at the bottom somewhere, and do as you see fit. But you can never accept your own answer.
0
 
LVL 18

Expert Comment

by:marilyng
ID: 18337188
Oops, you accepted sjef's instructions as the answer to your question.  
0
 

Author Comment

by:glentek
ID: 18337316
I did that deliberately.  They don't allow me to accept my own answer.
0
 
LVL 18

Expert Comment

by:marilyng
ID: 18337692
Understood.  However, people seeking a solution to a problem similar to yours will be mislead by the accepted answer.  When you post a solution you feel is independent of the suggestions, then you can ask customer service to refund your points.  In that scenario,  your solution becomes the answer to the question.

0
 

Author Comment

by:glentek
ID: 18337784
I judged that the discussion was a good one and deserved to remain at this web site.  If someone goes to the "accepted answer", they will see I wanted to accept my own answer, and will read it.

I'd rather they just provide the capability to accept one's own answer, but this will have to do...
0
 
LVL 5

Accepted Solution

by:
Netminder earned 0 total points
ID: 18354440
I have unaccepted the comments selected, refunded the points, and closed the question.

Netminder
Site Admin
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

This is an old article, please see an updated version of this article, located here: http://www.experts-exchange.com/articles/23619/Notes-8-5x-Windows-7-Notes-info-and-tips.html
Article by: Rob
Notes 8.5 Archiving Steps and Tips This article covers setting up a Notes archive, and helps understand some of the menu choices making setting up and maintaining a Notes archive file easier.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

706 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

18 Experts available now in Live!

Get 1:1 Help Now