Find Parenthesis

K

Kev

Trying to find all parentheses() in a word document. Not wanting to replace
them but copy them to another blank doc. I can find the begining "(" and the
end ")" but can not get it to read the letters inside the Parentheses.
 
J

Jean-Guy Marcil

Kev was telling us:
Kev nous racontait que :
Trying to find all parentheses() in a word document. Not wanting to
replace them but copy them to another blank doc. I can find the
begining "(" and the end ")" but can not get it to read the letters
inside the Parentheses.

Try this in the "Find What:" field of the Find dialog:

\(*\)

Make sure to check the "Use wild cards" box (Click on "More..." at the
bottom of the dialog).


--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 
K

Kev

Great, Is there a way to do that in VB.NET? I have been working on this for a
while, I am new to programming and been stumped on this one for a while.
 
J

Jean-Guy Marcil

Kev was telling us:
Kev nous racontait que :
Great, Is there a way to do that in VB.NET? I have been working on
this for a while, I am new to programming and been stumped on this
one for a while.

What code do you have so far?

--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 
K

Kev

Jean-Guy Marcil said:
Kev was telling us:
Kev nous racontait que :


What code do you have so far?

--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org


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?

Thanks
 
J

Jean-Guy Marcil

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
 
K

Kev

I was told that hashtables would be something to look into. In the little
training I have with VB.NET or programming at all , I have no idea if this
would help or make things easier. Do you have an opinion on hashtables?
 
J

Jean-Guy Marcil

Kev was telling us:
Kev nous racontait que :
I was told that hashtables would be something to look into. In the
little training I have with VB.NET or programming at all , I have no
idea if this would help or make things easier. Do you have an opinion
on hashtables?

Here is a link for info on this topic:
http://msdn.microsoft.com/library/d...frlrfsystemcollectionshashtableclasstopic.asp

But, having never used them outside of a programming lesson, I cannot really
advise you here.

Since your need is simple (You only need to compare the info in the doc with
the list once) and do not need to manipulate it further, I do not think that
it would actually make you life easier or make the code run that much
faster...

But I could be wrong!

--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top