|
-
March 6th, 2002, 05:32 AM
#1
give me a hand,thank you
I have a Word document.I want to input this document to a database.Generally,i will create a table in a database,then input a column ,then input next column. In order to save my time,now i want to input the whole Word document by a program.
please tell me some English information about this.Or tell me web sites.Thank you!
-
March 6th, 2002, 05:55 AM
#2
Re: give me a hand,thank you
It will all depend on whats in the document ie..Bitmaps,Tables etc.
If the Document is just text then thats no problem, if the document contains multiple objects then you have a problem.
Let me know whish it is and I'll tell you where to go from there.
Don't forget to rate!!!
Andrew Lennon (Berlitz)
Automation Dev Engineer
-
March 6th, 2002, 08:39 AM
#3
Re: give me a hand,thank you
The Document is just text.Thank you!!
-
March 6th, 2002, 09:11 AM
#4
Re: give me a hand,thank you
This code will open a specified Document (invisible) and loop through the activedocument to rebuild a single string for text (szwrd).
When adding this string to the database value should be a Memo Value so it's big enough to hold the string.
Dim wrd as Object
Dim szwrd as string
Dim i as Integer
i = 1
set wrd = CreateObject("Word.Application")
wrd.Visible = false
wrd.Documents.Open "C:\Temp.doc"
for i = i to wrd.ActiveDocument.Paragraphs.Count
szwrd = szwrd & wrd.ActiveDocument.Paragraphs(i).Range.Text
next i
set wrd = nothing
'ADD THIS string to YOUR DATABASE ----
'szwrd
Andy
Don't forget to rate Dude!!!
Andrew Lennon (Berlitz)
Automation Dev Engineer
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|