Macro opens a program several times

E

E. M

X-No-Archive: yes

I have this macro that opens a program and looks up the text selected in
Word; it works OK, but when the macro is run for the second time it opens
the program once more instead of making a second search (Control + S) within
the
program. Is it possible to "tell" the program not to open a second instance
if it is already open?

Thanks in advance for any info,

Selection.Copy
Dim appdtSearch As Variant
Dim TexteRecherche$
Dim Document
Dim Window
TexteRecherche$ = Selection
appdtSearch = Shell("C:\Program Files\dtSearch\bin\dtsearch.exe", 1)
SendKeys "^V" & "{ENTER}"
End Sub
 
H

Howard Kaikow

When using another program from within a Word macro, in general, there are
two choices:

1. As you have done, use Shell execute the program, ie., in effect tissue a
command from the command line. In this case, the program will always be
restarted.

2. A number of programs provide interfaces that allow the program to be
controlled by another program. If the dtsearch program provides such an
interface, then you need to find the documentation for its object model.
Then you can control the program from within Word. Otherwise, you are outta
luck.
 
E

E. Manchon

X-No-Archive: yes

Thanks for your prompt reply, from what you tell me, I am out of luck.

E.M.
 

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