Skip to main content link. Accesskey S
  • Help
  • HCL Logo
  • HCL Notes and Domino Application Development wiki
  • THIS WIKI IS READ-ONLY. Individual names altered for privacy purposes.
  • HCL Forums and Blogs
  • Home
  • Product Documentation
  • Community Articles
  • Learning Center
  • API Documentation
Search
Community Articles > Programming > How to Keep the Formatting when Copying NotesRichtext to Excel
  • Share Show Menu▼
  • Subscribe Show Menu▼

Recent articles by this author

When 38.3 - 38 equals 0.299999999999997... and what to do about it

Obviously I forgot about the "fraction()" function, so I removedchanged parts of this article (thanks @Mario for the hint) :)   If you need the digits behind the decimal seperator of a number, you might subtract the integer of the number from the number itself: 1.3 int(1.3) e.g. would result ...

When rounding 0.5 equals 0... and what to do about it

Do you know the difference between rounding a number commercially and rounding it mathematically? Notes does... This is, why in Formula @Round(0.5; 1) equals 1, but the equivalent in LotusScript round(0.5, 0) equals 0... Wonder if round(1.5, 0) equals 1? No, the result is...: 2 The reason is, that ...

The third SaveOptions value, or How to suppress the "Do you want to save this document?" message box in Notes

Yes, SaveOptions understands more than just "0" or "1": Did you ever face the problem, that Lotus Notes keeps asking if you want to save the current document, even though you just did? Picture the following scenario: A user creates a document with a certain form that contains a "Change Field ...

Pitfall on NotesUiDocument vs. NotesDocument field changes - unexpected "Reload"

When performing mixed changes on fields, i.e. changing fields in a NotesUiDocument and others in the corresponding backend NotesDocument, it is very important to make sure that they do not have any sideeffects on each other. Could be ugly...   To see what I mean, try this one:   Build a simple ...

Forgotten Notes Features: $PaperColor

Anyone remember, and actually uses (besides in his memos, maybe not knowing) the field "PaperColor" in Lotus Notes documents? Using this field, you can set a dynamic background color in your documents. The field needs to be numeric and contain a number from 1 to 238; usually this field will be ...
Community articleHow to Keep the Formatting when Copying NotesRichtext to Excel
Added by ~Frank Quetlupulikle | Edited by ~Frank Quetlupulikle on March 10, 2010 | Version 5
  • Actions Show Menu▼
expanded Abstract
collapsed Abstract
No abstract provided.
Tags: LotusScript Excel Word Export NotesRichtext
When you copy + paste a table or other contents from a NotesRichtextItem to Excel using LotusScript, the formatting mostly will get lost. There is a workaround to keep all the formatting and display your content in Excel just the way it appears in your NotesRichtextItem:

Copy+paste the content to Word first, copy it again to the clipboard, then close Word and paste the content of your clipboard to Excel. Works excellent.

Here is a sample code (assumes that you have an editable NotesRichtextItem "Body" on your document [with content in it] and a button that triggers the following code):

Sub Click(Source As Button)

' copy rt content

Dim ws As New NotesUIWorkspace

Dim uidoc As NotesUIDocument
Set uidoc = ws.CurrentDocument

Call uidoc.GotoField("Body")
Call uidoc.SelectAll
Call uidoc.Copy

' open word, paste and copy again
' (if we would paste to Excel directly, formatting would be lost)
Dim objWord As Variant
Set objWord = CreateObject("Word.Application")

Call objWord.Documents.Add()
Call objWord.Selection.Paste()

Call objWord.Selection.WholeStory()
Call objWord.Selection.Copy()

objWord.DisplayAlerts = False
Call objWord.quit(False)

' open excel and paste
Dim objExcel As Variant
Set objExcel = Nothing
Set objExcel = CreateObject("Excel.Application")

Call objExcel.Workbooks.Add()
Call objExcel.ActiveSheet.Paste()

objExcel.visible = True
End Sub



About the Author
Marcus Foerster works as Systems Architect for Pentos AG in Munich, Germany. His focus lies on the application side, creating collaboration systems for users, groups and enterprises to get their daily work done. This approach includes integrating complex workflows with intuitive user interfaces, using Lotus Notes/Domino with Adobe Flex and other Web technologies.
Read more in Marcus' blog: http://marcus.foerster.com/blog

  • Actions Show Menu▼


expanded Attachments (0)
collapsed Attachments (0)
Edit the article to add or modify attachments.
expanded Versions (5)
collapsed Versions (5)
Version Comparison     
VersionDateChanged by              Summary of changes
This version (5)Mar 10, 2010, 11:29:42 AM~Frank Quetlupulikle  
4Mar 10, 2010, 11:29:08 AM~Hank Nonhipilygon  
3Mar 10, 2010, 11:26:55 AM~Hank Nonhipilygon  
2Mar 10, 2010, 11:25:59 AM~Hank Nonhipilygon  
1Mar 10, 2010, 11:24:44 AM~Hank Nonhipilygon  
expanded Comments (0)
collapsed Comments (0)
Copy and paste this wiki markup to link to this article from another article in this wiki.
Go ElsewhereStay ConnectedAbout
  • HCL Software
  • HCL Digital Solutions community
  • HCL Software support
  • BlogsDigital Solutions blog
  • Community LinkHCL Software forums and blogs
  • About HCL
  • Privacy
  • Accessibility