Kev was telling us:
Kev nous racontait que :
Before we get headed in the wrong direction, this is what I am trying
to do with this program. I am tryin to find all the acronyms in a
document, compare them to a master table list with the definitions,
then append the acronym and its definition in a table to the end of
the document. The acronyms are always surrounded by parenthesis in
the document but what I am not sure of is the best way to make this
happen.
1. Is there a way to have VB.NET read the document and compare it to
the acronym master table, leave the acronyms that are found in the
document and remove the accronyms that are not found from the master
list, then append the results the the end of the document? or
2. Scan the document for anything in parenthesis, compare to a
database or the master list, get rid of the duplicates, then append
all the found acronyms to the end of the document? or...
3. Is there a better way you see to do this?
You can certainly do this with VB.Net, however, I am not proficient enough
with VB.Net to give you actual code.
But, what you need to do is:
Create a master list in a template as a 2-column table.
Create an array from all the items in parenthesis in your document, then
sort it and remove duplicates.
Create a document form your Master list template.
For each item in the master list first column, compare to each item in the
document array, if the master list item is not found, delete the
corresponding table row.
Finally, append that shorter version of the master list at then end of your
document.
Close without saving the document created from the master list.
(I could do all this in VBA, or even VB6 if I had to, but VB.NET... I would
have to spend too much time, which I do not have right now.
Try writing the code for each step of the overall procedure, then post back
in a new thread for each question you may have, unless someone already has
this kind of VB.NET code ready to go...)
--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site:
http://www.word.mvps.org