Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / February 2005

Tip: Looking for answers? Try searching our database.

exchanging info with another application

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
and - 25 Feb 2005 16:10 GMT
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
Helmut Weber - 25 Feb 2005 21:32 GMT
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".

>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
[quoted text clipped - 18 lines]
>
>ANDy
Helmut Weber - 25 Feb 2005 21:43 GMT
... 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/

>Hi ANdy,
>what application?
[quoted text clipped - 24 lines]
>>
>>ANDy
and - 28 Feb 2005 11:29 GMT
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.

>>I would like to open another application, open a dialog box
>>there and (with sendkeys) select and copy copy the contents of the box
[quoted text clipped - 10 lines]
>>
>>How can I copy info from and to the Windows clipboard in VBA?
Helmut Weber - 28 Feb 2005 17:10 GMT
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/
and - 28 Feb 2005 17:35 GMT
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

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.