exchanging info with another application

A

and

Hi there, I would like to open another application, open a dialog box
there and (with sendkeys) select and copy copy the contents of the box
to the Windows Clipboard, copy it into a VBA variable, compare it, edit
it automatically (based on rules), and copy the result back to the
Windows clipboard, and then on to the dialog box in the other
application. This process has to be repeated several times (I know how
to make loops).

Therefore I need to know a couple of things:

How can I activate another application, and go back to Word, by VBA (the
other application is not supposed to be closed)?

How can I copy info from and to the Windows clipboard in VBA?


I'm open to all suggestions as how to approach this challenge. I hope
this can be done with VBA, since I don't write C+ or any other
programming language.

Best regards,

ANDy
 
H

Helmut Weber

Hi ANdy,
what application?
What is it, that you want to do?
Differentiate between tools and goals:
" I got a hammer and want to drill a hole".
 
H

Helmut Weber

.... sorry,

I hit the wrong button in the newsreader.

For controlling other applications from Word,
see getobject, createobject

for the clipboard
see
MSForms
Dataobject
GetFromClipboard
PutInClipboard

I don't know where to start.

Greetings from Bavaria, Germany

Helmut Weber, MVP
"red.sys" & chr(64) & "t-online.de"
Word XP, Win 98
http://word.mvps.org/
 
A

and

Hi Helmut,

Thanks for your attempt to help.
what application?
A dictionary application (Van Dale Groot woordenboek Engels-Nederlands).
The executable is `VDEN.exe'. I don't mention it because, to most people
in this group, it is unknown.
What is it, that you want to do?
Select the text of all entries that I have entered myself, copy it to a
Word document, manipulate the text (manually or automatically), copy the
manipulated text back to the same dictionary application.

I need to activate this application and then, with sendkeys (since I
guess there is no other way) select, copy and past text.
 
H

Helmut Weber

Hi Andy,

if VDEN.exe is in no way programmable,
not to be seen anything like it in extras references,
then indeed for controlling it you may have to rely
on another program like Word and to use sendkeys.

Notoriously unreliable.

Close all other programs.
Disconnect from anything.

Activating any application is easy: shell(),
but could be done manually as well.

If, hopefully, Sendkeys is working at all,
then you wouldn't need the clipboard,
as you could send all letters to an inputbox or so
in VDEN.exe. If this fails only partly, you might try
to use the clipboard. For that, you need a reference
to the MSForms-Library, which, alas, might not to be
found in extras references, but is added automatically,
as soon as you have a userform somewhere in your VBA-code.
Just any userform, you don't have to use it.
Then you can create a dataobject and use methods like
putinclipboard.

Good Luck

Greetings from Bavaria, Germany

Helmut Weber, MVP
"red.sys" & chr(64) & "t-online.de"
Word XP, Win 98
http://word.mvps.org/
 
A

and

Hi Helmut,

Thanks for the extra info. I may decide to use macro mania to get the
job done, if the method you describe is that unreliable.

But I'll do some tests to see how things go.

Best regards,
ANDy
 

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