Reading a MS Word File and creating respective documents in lotus notes database (6.5.5))

I am trying to design an agent, which would read an MS Word (.doc) file content and create respective documents in lotus notes documents.

The content of the MS word document will have a parser as Pilcrow symbol or “~” tilde symbol, the parser will indicate the end of document.

The issue i am facing now, is the entire content of the MS Word file needs to read in single line of code.

if i go for looping then the performance is very poor.

i tried to use getobject(,“Word.Application”) and try to ran on the server console but it is keep on running or i am getting an “automation object error”.

my requirements:

1. I need to fetch the data in word along with the same style and format(the space, paragraph intend everything) 

2. Performance should be good

3. I should be able to parse the data easily

Please do provide your valuable comments and codes.

Subject: Reading a MS Word File and creating respective documents in lotus notes database (6.5.5))

Hi,

Please, provide Your code with comments where have You problem (in which line). I’m not able to help Your without knowing details and sorry but I have not so much time to give You full solution with code which will be working, with good performance.

Regards,

Konrad

Subject: RE: Reading a MS Word File and creating respective documents in lotus notes database (6.5.5))

thanks for the response Konrad.

Dim WordObj As Variant

Dim FileName As String

FileName = “D:\test.doc”

If FileName$ <> " " Then

	filenum = Freefile()

	Open Filepath For Input As fileNum%

	Do Until Eof(fileNum%)

		Line Input #fileNum%, txt$

		Temp = Temp & txt$

	Loop

End If

Set WordObj = GetObject (FileName,“Word.Application”)

PghCount = WordObj.Paragraphs.count

Msgbox PghCount,,"PghCount"