Hi =?Utf-8?B?U2Ft?=,
If I want to load data info from pure txt file into specific cell of one
table in Word document, what kind of method should I use? Could you give me
some simple code sample?
For example, I have a 'txt' file, with some contact info(Incluing
name,telephone number, address,Email...)
I want to use those contact info to fill one table(which have two columns,
name and email) in word document. In the table, it only give the name info,
we should fill the email column by ourself. How can we collect info from the
'txt' file? it is possible to use VBA to fill the email info automatively?
Could you give me some hints?
It's really impossible to even begin to think about this without knowing how
the XML is structured. Probably, I'd "walk" the text file line-by-line and use
Instr to check whether the line contains the "Name". If it does, then I'd move
down the required number of lines to the Email address, if the text file is
structured so that this would be possible.
If everything is on one line, which would be quite possible with XML, then you
might have to read character-by-character, comparing the result to a particular
string (such as the XML tag and the name), then continue until you get the
email XML tag, then start accumulating the characters within that tag until you
hit the end-tag.
Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org
This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail