0
votes

I am trying to paste the Lotus Notes email body to Word document and I'm almost successful in doing that. But when I paste the content to word it does not show the hyperlinks, it will just paste as text. Below is what I have tried so far. I would want the hyperlinks also from body of the email to be pasted to word document.

Set NSession = CreateObject("Notes.NotesSession") 
Set NMailDb = NSession.GetDatabase("", "") 


If Not NMailDb.IsOpen Then 

NMailDb.OPENMAIL 

End If 

Set NDocs = NMailDb.GetView(view) 
NDocs.Clear 


If filterText <> "" Then 

NDocs.FTSEARCH filterText, 0 

End If 

Set NDoc = NDocs.GetFirstDocument 


Do Until Left(NDoc.GETITEMVALUE("PostedDate")(0), 8) <> Left(Now(), 8) 

Set NNextDoc = NDocs.GetNextDocument(NDoc) 

If Left(NDoc.GETITEMVALUE("PostedDate")(0), 8) = Left(Now(), 8) Then 


    If InStr(3, NDoc.GETITEMVALUE("From")(0), "From", vbTextCompare) > 0 Then 


        Set NItem = NDoc.GetFirstItem("Body") 

        Set wrdApp = CreateObject("Word.Application") 
        Set wrdDoc = wrdApp.Documents.Open("C:\https.docm") 
        wrdApp.Visible = True 
        Set objSelection = wrdApp.Selection 

        objSelection.TypeText NDoc.GETITEMVALUE("Body")(0) 
1
Which version of Notes, on which platform, And which version of Word are you trying this with ?Simon Delicata
Lotus Notes 8.5 , Microsoft Word 2013 and Windows 7 - System type is 64-bit operating systemYashish Karkera

1 Answers

0
votes

You are using the GetItemValue method in the NotesDocument class. The documentation for this method clearly says that the return type when this method is used on a rich text field is "Array of strings. The text in the item, rendered into plain text."

Getting formatted text out of a Notes document is very difficult, requiring dealing with the fact that Notes can use two completely different formats for storing formatted text. With MIME format, it is possible to the the NotesMIMEEntity class and it's associated methods to get at HTML-formatted text. With rich text format, the NotesRichText class provides only limited access to the working with rich text and something like this is probably best done using third party tools like the MIDAS Rich Text API.