What happen to the table?

Hi all,

I succeeded in importing the MS-Word into notes field which is of “Rich Text” type. the following code is as follows:

Dim ws As New NotesUIWorkspace 

Dim db As NotesDatabase 

Dim newdoc As NotesDocument

Dim rtitem As NotesRichTextItem

Dim rtitem2 As NotesRichTextItem

Dim object As NotesEmbeddedObject



Set s =New NotesSession

Set db=s.CurrentDatabase

Set newdoc= New NotesDocument (db)

newdoc.form = "final"



'select form to use for a new document

Set WordObj = CreateObject("Word.Application")

WordObj.visible = False

Set WordDocs = WordObj.Documents

path = "C:\"

fname = "PURCHASING POLICY CPS03101E"

Set Worddoc = WordDocs.Open(path+fname) 'you need the path and filename of the word document you want to import

Set Rnge = WordDoc.Range()

Rnge.Copy

WordDoc.Close

Call WordObj.Application.quit

Sleep 2



'fname = Left(fname,Instr(fname,".")-1)

Call newdoc.ComputeWithForm(False, False) 

Call newdoc.Save(True, True)



Set uidoc = ws.EditDocument (False, newdoc)

uidoc.editmode = True

Call uidoc.GotoField( "body" )

Call uidoc.Paste 

Sleep 1



Call uidoc.Save 

Call uidoc.Close 

However i met with a problem, the alignment of the words in MS-Word become very different when paste into the notes. Is there anyway i can rectified it?

AND there are multiple pages for the MS-Word document, hence i was thinking if anyone have any idea on how to create a new document in notes whenever it is a new page in MS-Word

Many thanx in advance

Best,

Hengshi

Subject: What happen to the table?

I’d recommend looking at the NotesUIDocument.Import method. You can tell it that you are importing a MS Word file and you will get a much better rendering than the copy/paste routine.