0

It directly deals with this one: Cannot instanciate a NotesUIWorkspace from VBA (Word)

As the machines will have Win7 64 this old way isn't appropiate any more.

So how can I copy formatted text that is stored in a NotesRichtextItem, including tables, into a Word document at a predefined space? My idea, without a proof is to use XML to extract RTF content, replace some unformatted text values (this is also a goal) and transfer it into the Word doc via VBA or LS. Both ways are ok. I am able to use the Notes backend classes from my VBA code though, only the NotesUIWorkspace will not be available in a 64bit environment.

Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
Oliver Busse
  • 3,375
  • 1
  • 16
  • 26

2 Answers2

1

One possible approach would be to get the NotesRichTextItem content as HTML, and then use whatever facilities are available to you in VBA to work with that HTML and get it into your Word doc.

The answers to this question describe several possible ways that you might be able to use to get HTML from the rich text.

Community
  • 1
  • 1
Richard Schwartz
  • 14,463
  • 2
  • 23
  • 41
  • Link to "this question" seems to be missing. – Panu Haaramo Apr 11 '13 at 06:23
  • Corrected! Thanks, Panu :-) – Richard Schwartz Apr 11 '13 at 15:36
  • 1
    I now use the doc.convertToMime(3) method and then get the html by reading the mimeEntity.contentAsText property from my richtext item. I "only" have to find out how to insert that text string into word with VBA... It just pastes the html as plain text and does not convert it, but I am lucky with the first half of the whole solution ;-) Thanks everyone! – Oliver Busse Apr 19 '13 at 11:25
0

You should be able to access the NotesRichTextItem and walk through using the NotesRichTextNavigator to find each NotesRichTextRange, then get the type (which can be table or table cell) and style. You should be able to build your Word doc from the strings and style using VB, perhaps including table elements. Theoretically, at least.

David Navarre
  • 1,022
  • 10
  • 27