Following is the code I have written to export Notes documents to Microsoft Word. I have a couple of issues when running this code:
I keep getting a message about saving redaction.dot when I attempt to close the newly created Word document.
The newly created Word document does nto open with “Open” … it has been corrupted somehow and I must use FILE-OPEN AND REPAIR and re-save it to make it usable. The error references “Table end-of-cell markers”.
I have searched through this forum as well as the Domino 4-5 forum and have not had any luck. Is there someone out there who can assist? I have a hot project that is rolling out very soon and I have to have this functionality available.
TIA,
mvp
Sub Initialize
'Declare object variables
Dim ws As New NotesUIWorkspace
Dim uidoc As NotesUIDocument
Dim doc As NotesDocument
Dim WordAppl As Variant
Dim WordDoc As Variant
'Initialize OLE object
Set WordAppl = CreateObject("Word.Application")
WordAppl.visible = False
’ Creates a new Word document
Set WordDoc = WordAppl.Documents.Add()
'Initialize database object and uidoc object
Set uidoc = ws.editdocument(True)
Set doc = uidoc.document
If I leave out the paste, then the document contents do not get put into the Word document (of course), but I can open the empty Word document just fine. Also, I still receive the error messages concerning redaction.dot.
If I omit the quit, The Word document with the pasted notes document, are left open. When I press “X” to close teh document:
I receive the promot: “Word cannot save this file because it is already open elsewhere. (C:\Program Files\ … \Redaction.dot)”
I click OK to exit this dialog and receive the prompt: “Do you want to save the changes to Redaction.dot?”
I respond NO to this prompt.
When I attempt to open the Word document, I receive the following error:
Word is unable to read thsi document. It may be corrupt. Try one or more of the following:
** Open and Repair the file
** Open the file with the Text Recovery converter
Open and Repair allows me to open the document as I indicated in my initial post. I have not attempted the 2nd.
Rob, I uninstalled the add-in Redacrion yesteray and that resolved one problem. I still am having the issue with corrupted Word documents being created and only when the entire document is being copied/pasted. If I copy individual fields, I do not have an issue.
The documents I am trying to move to Word are varied in fields, etc., so copying individually is not an option.