RunApp to Launch WordPerfect

K

Karen Hart

I am using a macro in Access XP to launch WordPerfect Version 9 (2000) and
execute a macro upon starting WordPerfect. It works fine if WordPerfect is
closed when I execute the macro, but not if WordPerfect is already open and
running in the background.

My macro:
Action: RunApp
Command Line: wpwin9.exe /m-merge.wcm

If WordPerfect is already open and running in the background when I execute
the macro, the WordPerfect icon on the taskbar starts flashing. When I click
on it to switch windows to WordPerfect, the WordPerfect screen opens but the
macro "merge.wcm" doesn't execute.

Any ideas would be appreciated and considered a wonderful holiday gift!
Happy Holidaze,
Karen
 
A

Albert D. Kallal

Just launch the document name..and whatever application is attached to the
document will run, and if already loaded..then it is already loaded.

Dump the use of macros..and simply use:

application.FollowHyperlink "c:\data dir\you doc name goes here"

However, it seems you are launching wp, and then telling it to run a macro.
My above suggest assumes that you can smiply use (launch) the document to
run a macro. If wp don't work this way..then the above is not much help...

And, perhaps you could add some code to your wp macro that shuts down
wp..and thus you don't wind up with multiple copies running (you might have
two copies running if wp is alreayd loaded..but at least at the end of the
maco..if you shut down wp..then after the macro runs..you only got one, or
none copies of wp left running)
 
K

Karen Hart

Sorry Albert, this is not workable. I don't think you read my question quite
carefully enough. And it is not a solution to write code to shut down wp
first, as users may have multiple documents in wp open.
 
A

Albert D. Kallal

And it is not a solution to write code to shut down wp first, as users may
have multiple documents in wp open.

In some cases, if all your do is run a bunch of macros that does some
processing, loads some labels, prints them etc, then actually the fact of
2nd copies of wp being opened by the macro is a good thing. The user might
be running wp with 3, or a dozen documents open. When we launch a 2nd copy
of wp..we run our processing/macros etc..and then at the very end close down
this 2nd copy of wp. What this means that is in fact we do not disturb, or
bother the existing running copy of wp (and the potentially open ed
documents etc.). And, read carefully:

shut down wp first

NO, I am not suggesting to shut down wp first, but I am most certainly
suggesting that at the END OF your macro you shut down wp. That way, if you
runApp the macro 10 times..you don't get 10 copies of wp running (since the
macro when done can shut down wp). As mentioned, if you always launch a 2nd
(or "new") copy of wp to run this macro, and then close down this 2nd (or
"new") copy, then you never disturb the users currently opened documents.
Hence, over the years..this is a possible solution, and a concept you seem
to have missed.

However, I did also go on to mention that :

In other words, after you macro runs..you put the computer back into the
same state it was before. If none copies of wp were running at the start of
this process, then at the end of the process...none will be running. And, of
course if the user have wp open..then that users copy will remain
opened..and we don't disturb it. So, we launch our own copy...do our
work..and close it.

However, if the macro requites user intervention, or the results in a
working document for the user AFTER the macro runs and that the user needs
to work on this document, then my suggestion is of no, or little use.
Obviously, if the user now starts working with the 2nd copy and some
document that we created, then we can't close this additional copy of
wp..can we?

So, in summary, if that macro does not need or result in needed wp to be
open...then simply close it when done, and you completely solve the problem
of a additional copies of wp being left running. And, if the macro after
being run needs wp to remain open, then my suggestion is of no use...

I understand that the above may not help you..but you seemed to missed my
point. And, in fact as a general rule and approach to computing problems,
placing the computer back in the same state as to when you code starts is a
traditional solution to many computer problems.

So, yes, you could engage some fancy programming to check if a existing copy
of wp is running, but simply closing down what you opened after you are done
eliminates this need altogether.
 

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