473,790 Members | 3,200 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

read a directory of word (2000) documents into a db

I have a directory of word docs (maybe 2 or 3 hundred),
all of the docs are
based on a custom template and they have 20 or so fields,
I would like to
read all of the fields into a db. Any help would be
appreciated.

gabe
Nov 20 '05 #1
3 1107
Well, without actually writing the code, the general direction is this.

1.) Add a reference to the word COM see references in Solution explorer
2.) Write some code, here is a very simple snipit
Dim wrd As New Word.Applicatio nClass

Dim doc As New Word.DocumentCl ass

doc = wrd.Documents.O pen("c:\test.do c")

MessageBox.Show (doc.Name)

doc.Close()

3.) Then store the retrieved data in a DataTable for example.

OHM#




gabe wrote:
I have a directory of word docs (maybe 2 or 3 hundred),
all of the docs are
based on a custom template and they have 20 or so fields,
I would like to
read all of the fields into a db. Any help would be
appreciated.

gabe


Regards - OHM# On**********@BT Internet.com
Nov 20 '05 #2
More specifically Im looking for a feild object. There is
a bunch of info in the docs that I don't want - I just
need the feilds. Thank-you again in advance.

gabe

-----Original Message-----
Well, without actually writing the code, the general direction is this.
1.) Add a reference to the word COM see references in Solution explorer2.) Write some code, here is a very simple snipit
Dim wrd As New Word.Applicatio nClass

Dim doc As New Word.DocumentCl ass

doc = wrd.Documents.O pen("c:\test.do c")

MessageBox.Sho w(doc.Name)

doc.Close()

3.) Then store the retrieved data in a DataTable for example.
OHM#




gabe wrote:
I have a directory of word docs (maybe 2 or 3 hundred),
all of the docs are
based on a custom template and they have 20 or so fields, I would like to
read all of the fields into a db. Any help would be
appreciated.

gabe


Regards - OHM# On**********@BT Internet.com
.

Nov 20 '05 #3
Yes, I know and realise this. However, if you do what I suggested you can
view the word Application classes using the object browser. I noticed Fields
was one of the properties. However, as I dont know the words objects very
well, for brevity I decided to just call the name property to prove I had
gotten the document.

Surely you can take it from here ?

Regards - OHM
an*******@discu ssions.microsof t.com wrote:
More specifically Im looking for a feild object. There is
a bunch of info in the docs that I don't want - I just
need the feilds. Thank-you again in advance.

gabe

-----Original Message-----
Well, without actually writing the code, the general direction is
this.

1.) Add a reference to the word COM see references in Solution
explorer
2.) Write some code, here is a very simple snipit
Dim wrd As New Word.Applicatio nClass

Dim doc As New Word.DocumentCl ass

doc = wrd.Documents.O pen("c:\test.do c")

MessageBox.Show (doc.Name)

doc.Close()

3.) Then store the retrieved data in a DataTable for example.

OHM#




gabe wrote:
I have a directory of word docs (maybe 2 or 3 hundred),
all of the docs are
based on a custom template and they have 20 or so fields,
I would like to
read all of the fields into a db. Any help would be
appreciated.

gabe


Regards - OHM# On**********@BT Internet.com
.


Regards - OHM# OneHandedMan{at }BTInternet{dot }com
Nov 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1660
by: dixie | last post by:
I am trying to send information to 2 different MS Word 2000 documents from automation code in Access 2000. I have simply added an extra transfer text command and an extra line to open the document with the data text file for the merge data. What is happening is that only the 2nd of the two letters is opened. Why doesn't the first one open? Is there a way of having two (almost) simultaneous Word documents opened from within a module in...
10
3062
by: Neil | last post by:
An article at http://news.com.com/2100-1012-991694.html?tag=fd_top states: "XML would allow easier interchange of data generated in Office documents with back-end systems or existing Web services." As part of an Access 2000 application, I have to continually parse Word documents and store the parsings in Access tables using Automation to control Word and parse the document. Is there a way that XML would help with that? Thanks.
8
3181
by: sudha | last post by:
Hi, To open a word doc from c#, i use the following code : Word.ApplicationClass WordApp = new Word.ApplicationClass (); // give any file name of your choice. object fileName = "C:\\test.doc"; object readOnly = false;
0
6299
by: mharris | last post by:
I need help with merging two Word documents into one through C# code. The problem isn't so much getting the documents put into one as it is maintaining the appropriate formatting, or rather reformating, after the merge. This is a full description of my needs. I have a C# class library that creates two Crystal Reports, and then exports them to the harddrive as Word documents. One's orientation is landscape, the other is portrait. I then...
0
1472
by: Steve | last post by:
I am noticing a problem when interfacing with Word through my C# code. What I am trying to do is enumerate through the documents currently open in Word. I have noticed issues with this on both methods I can think to try. We are using COM objects, because we need compatibility with Word 2000. I am testing this against Word 2003 however. For simplicity sake, I have two documents open, 1.doc and 2.doc.
16
1734
by: Simon Verona | last post by:
I have a problem with automating MS Word through vb.net My code is : Dim objword As new Word.ApplicationClass Try objWord.Documents.Open(letterfile) objWord.Documents.Item(letterfile).Activate() Catch MsgBox("Error - Word Not running properly - letterfile=" & letterfile &
7
6251
by: Dave | last post by:
Apologies for the newbie question. I have created a vb.net program for my company that is designed to work with Word Templates (about forty of them that we commonly use) that are selected by the user and populated (with info from an Access database) at run-time, then saved as Word documents. The program I have coded works fine -- it does what I need it to do. But it has two problems: (1) it runs very slowly, and (2) it does not seem to...
4
12444
by: etuncer | last post by:
Hello All, I have Access 2003, and am trying to build a database for my small company. I want to be able to create a word document based on the data entered through a form. the real question is this: can Access create the document and place it as an OLE object to the relevant table? Any help is greatly appreciated. Ricky
3
5936
by: Maurizio | last post by:
I create an application with Access 2000 and I wish to read/write the properties of a specified word document. I use dsofile.dll my code is Function fGetDocProps(strInFile As String, strProp As String) Dim objWord As Object, objDocProps As Object On Error GoTo Err_fGetDocProps Set objWord = CreateObject("Word.Application") objWord.Documents.Open strInFile
0
9666
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10419
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10147
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9987
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7531
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6770
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5424
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5552
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3709
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.