Hi,
In the previous releases it was not possible to Export documents to the Word-Format. Is this still valid - or - any new functions available?
Thanks,
Ernst
Hi,
In the previous releases it was not possible to Export documents to the Word-Format. Is this still valid - or - any new functions available?
Thanks,
Ernst
Subject: Export to MS Word
There are various reasons, none of them good, but mostly due to the fact that the export was not working well. It is still possible to use the @Command([FileExport] approach and export to Word, but the results are not so great. See my article Exporting to MS Word for further thoughts and a 3rd party alternative.
Subject: Export to MS Word
I’ve been able to use Lotus Script to create a Word Document from Notes and “export” the values of the fields.
Code Example:
Dim s As New NotesSession
Dim db As NotesDatabase
Set db = s.CurrentDatabase
Dim view As NotesView
Set view = db.GetView(“Comments”)
Dim doc As NotesDocument
Dim wordObj As Variant
Set doc = view.GetFirstDocument
While Not doc Is Nothing
Comments = doc.Renew_Comments(0)
FileName = “C:\TEMP\WORD.DOC”
Set wordObj = CreateObject(“Word.Application”)
Call wordObj.Documents.Add
Call wordObj.Selection.TypeText(Comments)
Call wordObj.ActiveDocument.SaveAs(FileName)
Call wordObj.ActiveDocument.Close
Set doc = view.GetNextDocument(doc)
Wend
End Sub
Each “Call wordObj” line contains the Visual Basic code that Word uses. To get specific VB codes for whatever you need, you can create a macro in MS Word, go through whatever commands you need to format the document, add text, etc., then look at the VB code through the MS Word Macro Editor.
Subject: RE: Export to MS Word
Eric,I am new at LotusScripting and I got an error when using this saying:
Variable Not Declared: COMMENTS
Variable Not Declared: FILENAME