Hi =?Utf-8?B?TWVkZXM=?=,
I have a shared add-in that contains a simple button , i want that my button
do this:
when you click the button a windows opens that contains a textbox and a "ok"
button when you write a string in the textbox and clik on the "ok" button it
finds the string in the word document,
I am newbie , how it possible?
Well, speaking only about locating the string in the document (that's what's in
your subject line), I suggest you begin by going into the Word interface.
Familiarize yourself with how Edit/Find works. Then start the macro recorder
(Tools/Macro/Record new macro) and repeat the actions you've practised (finding
any text string). Stop the macro recorder (you should see a "Macro" toolbar
with a Stop button). Press Alt+F11 to go into Word's VB-Editor, open the
"NewMacros" module and look at the recorded code.
This gives you the basic syntax you require in your Addin. By clicking in any
of the terms in the recorded code, then pressing F1, you can open Help to that
topic if you need more information.
Note that the macro recorder will almost always work with the SELECTION object.
For the most part, you should substitute SELECTION with the appropriate object
from Word's object model. In the case of FIND, that would be RANGE. (So,
instead of Selection.Find you should use Range.Find).
When automating Word and using FIND, you need to be aware of this potential
problem
Find crashes Word automation code
..NET
http://support.microsoft.com/default.aspx?scid=kb;en-us;313104
COM
http://support.microsoft.com/kb/292744/EN-US/
If you need more assistance, you must tell us in which programming environment
you're working, and what version of Word you're targeting.
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