Converting Word Doc Into Columns
says...
Quote:
> No every record does not always have 14 lines and yes sometimes info is
> missing. But if there is some VBA code that could run through the whole
> document and first find all the "Salutations" plus a tab plus whatever (Mr,
> Ms, Mrs). There is always a tab after field name(ie, Salutation, First_Name
> etc)
> Salutation(Tab)Mr
> Is there anyway to go through the whole document and select Salutation plus
> a Tab plus say up to 10 characters.
> > Does every record have 14 lines...What if some info is missing?
> > >Hello Anyone;
> > >I hoping someone can find me a shortcut to my problem. I have a word
> > >document I was given with a list of some 2000 individuals with First
> Name,
> > >Last Name, Address, Phone Number ect. I want to some how extract this
> info
> > >and place them in column format so that I can eventually put them into an
> > >Access database which will make them usable.
> > >Here is an example;
> > >Salutation Mr. Last Name John Country of Origin Pakistan
> > > First Name Smith
> > >Home Address 703 - 1405 Prince of Wales Drive Period of Sponsorship
> > > Beginning Date 01/09/94 Ending Date 31/08/99
> > > Actual Date of Completion 31/08/99
> > > Ottawa ON Degree Ph.D.
> > > K2C 3J9
> > > Field of Study Economics
> > >Telephone: 613-555-9588
> > >Fax: 613-555-9588 University Carleton
> > > Supervisor Prof. Brian Erard
> > >Status: D
> > > Telephone:
> > >Is the some VBA code that I could use to select for example, Salutation
> > plus
> > >1 tab and then a certain amount of characters and select all of these
> > within
> > >the document and past the results into excel. Then proceed to do this
> with
> > >Last Name, First Name ect.
> > >Any suggestions or ideas would be very much appreciated.
> > >Thanks
> > >Greg Murphy
> > >Consulting And Audit Canada
> > >Ottawa, Ontario
> > >Canada
You are using the wrong approach for this kind of problem. The lack of
information will make it very difficult to do any kind of direct import
into a spreadsheet or database, because those programs select fields
based on physical or sequential position, which are not consistent here.
What you need to do is to convert each field into a separate record,
generating a common case ID for each individual and with the field name
as an identifier, then do an insert/merge to combine the records for each
case into a single flat file record that can be imported into a database.
I don't know enough VBA to know if this is directly possible with Office
components, but I have done this kind of thing with a combination of text
tools and various types of proprietary software.
--
Jan Werner