Opening a Doc. when App. is running - impossible? 
Author Message
 Opening a Doc. when App. is running - impossible?

I apologize if this is too much of a newbie question, but I couldn't find
anything about it in the FAQ.

I'm developing an application that does something very simple:  It
launches an application and opens a document using the SHELL command,
something like this*:


It works like a charm the first time.  The app. launches, my document
opens beautifully.  The second time I call SHELL, though, when the
application is already running, it tells me that I can't run more than one
instance of the application.  Heck, I knew that.  I didn't WANT more than
once instance, I want my document open.

I ported this project over from the Macintosh (where it used Applescript),
and on the Mac, when you launch an associated document and the associated
application is running, it does what you'd expect it to do, that is, give
the focus to the application and open the document.  Wait, let me put on
my asbestos underpants here.

If the application I'm launching could receive a DDE command to close its
existing document and open another, I could talk directly to it, however,
it doesn't know anything about DDE.

Is there a correct way to do this, or is it impossible?  If it's
impossible, can anybody think of a workaround?  Perhaps there's some way
to send the application the keystrokes to open the document?  Remember
this is not an aware application.

Finally, this is being developed on 3.1.  Will it behave differently
(please!) under Windows 95?

I'd appreciate any answers I can get, even guesses or pointers to other
similar questions.

* For those who care about the specifics, I'm using this to have a web
browser open the document with a single click (after first registering the
appropriate protocol).  The application is a dynamic modeling package
called STELLA, not FOOBAR.  My little VB application will receive the URL
info from Netscape or IE and parse out the document name, then open it.
I've thought about JAVA or ActiveX, but that seems to be overkill for this
simple action, and a lot of what I'd be doing would be working around
those products' security-motivated dislike of launching an app. from a
local disk.

Sat, 13 Nov 1999 03:00:00 GMT  
 [ 1 post ] 

 Relevant Pages 

1. Auto close open doc when opening another doc

2. run macro when doc is opened

3. running a macro when a doc is opened

4. Macros don't run when doc opened by IE5

5. Auto run form when u open a word doc

6. Menu on activeX Doc disappears when running internet download app

7. Open word 97 doc with doc name as variable

8. Open a doc, grab a range without having the whole doc being tabled

9. Opening a Word97 doc as a copy with no doc title

10. Excel open .doc or word open .xls?

11. Run query when app opens

12. run a macro when app opens


Powered by phpBB® Forum Software