Skip to main content link. Accesskey S
  • Anonymous
  • Log on
  • Help
  • IBM logo
  • Lotus Notes and Domino Application Development wiki
  • All Wikis
  • Home
  • Community Articles
  • Product Documentation
  • Learning Center


Search

Advanced Search

Categories

Tag Cloud

  • 6.0
  • 6.5
  • 8.0
  • 8.5
  • 8.5.1
  • 8.5.2
  • 8.5.3
  • action bar
  • Agents
  • Ajax
  • app dev
  • Application
  • beginner
  • C&S
  • calendaring and scheduling
  • client
  • composite applications
  • Controls
  • converters
  • css
  • Custom controls
  • Data Binding
  • db2
  • design elements
  • dialog boxes
  • Documents
  • Dojo
  • Domino
  • Domino Designer
  • Domino Designer 8.5
  • DXL
  • Eclipse
  • error handling
  • errors
  • extensions
  • FAQ
  • Forms
  • formulas
  • getting started
  • globalization
  • Help
  • html
  • Installation
  • interface
  • internationalization
  • iPhone
  • Java
  • JavaScript
  • localization
  • Lotus Domino Designer
  • LotusScript
  • LotusSphere
  • LotusTechInfo
  • menu bar
  • Mobile
  • new user
  • Notes
  • Notes 8
  • notes.ini
  • NSD
  • OpenNTF
  • partial update
  • performance
  • Pickers
  • Portal
  • presentations
  • programming
  • Redbooks
  • Requested Articles
  • roadmap
  • rooms and resources
  • samples
  • Scripting
  • security
  • tabs
  • templates
  • themes
  • Tips
  • toolbar
  • troubleshooting
  • tutorials
  • validation
  • variables
  • video
  • VideoFest
  • View
  • view control
  • ViewPanel
  • Views
  • web
  • Web apps
  • Web services
  • webdev
  • XML
  • Xpage
  • XPages
  • XPages Extensibility API
  • xsp-config
  • データソース
  • 九州地区ノーツパートナー会
InformationInformation
You are currently viewing machine translated content. IBM translation might be available. Click IBM Translated Product Documentation to see what is available.X


Home > Programming > How to Keep the Formatting when Copying NotesRichtext to Excel
Rate this article 1 starRate this article 2 starsRate this article 3 starsRate this article 4 starsRate this article 5 stars

How to Keep the Formatting when Copying NotesRichtext to Excel 

expanded Abstract
collapsed Abstract
No abstract provided.
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

expanded Article information
collapsed Article information
Category:
Programming
Tags:
LotusScript Excel Word Export NotesRichtext

This Version: Version 5 March 10, 2010 6:29:42 AM by Marcus MF Foerster  

expanded Attachments (0)
collapsed Attachments (0)

 


expanded Versions (5)
collapsed Versions (5)
Version Comparison     
Version Date Changed by               Summary of changes
This version (5) Mar 10, 2010 6:29:42 AM Marcus MF Foerster  
4 Mar 10, 2010 6:29:08 AM Marcus MF Foerster  
3 Mar 10, 2010 6:26:55 AM Marcus MF Foerster  
2 Mar 10, 2010 6:25:59 AM Marcus MF Foerster  
1 Mar 10, 2010 6:24:44 AM Marcus MF Foerster  
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 ConnectedSubscribe to RSSHelpAbout
  • All Lotus and WebSphere Portal wikis
  • IBM developerWorks
  • IBM Software support
  • IBM Social Business User Experience Blog
  • IBMSocialBizUX on Twitter
  • IBMSocialBizUX on Facebook
  • Lotus product forums
  • IBM Social Business UX blog
  • IBM Collaboration Solutions
  • Recently added feedRecently added
  • Recently edited feedRecently edited
  • Recently added comments feedRecently Added Comments
  • Wiki Help
  • Forgot user name/password
  • Wiki design feedback
  • Content feedback
  • About the wiki
  • About IBM
  • Privacy
  • Contact IBM
  • IBM Terms of use
  • Wiki terms of use