Re: Launch a doc file with Process.Start(my.doc), need to know when the file is closed.

From: Tony (tonyng2_at_spacecommand.net)
Date: 12/09/04


Date: Thu, 9 Dec 2004 10:30:41 -0600

Will not be using automation and not guaranteed that it will be an office
application that is launched, can be of any file type.

I think the Process object returned from Process.Start() will work for me.

Thanks,
Tony

"Paul Clement" <UseAdddressAtEndofMessage@swspectrum.com> wrote in message
news:hnmgr09bdjsm7vk85su0sgoeualbpgpq8n@4ax.com...
> On Wed, 8 Dec 2004 10:56:36 -0600, "Tony" <tonyng2@spacecommand.net>
> wrote:
>
> ¤ I'm storing documents and images in a client database.
> ¤
> ¤ I want to be able to launch a document or image into the proper
> application
> ¤ that can view or modify the object. I do this by copying the object from
> the
> ¤ database to the temp directory then calling Process.Start(filename)
> which
> ¤ launches the correct application and displays the file - all works
> great.
> ¤
> ¤
> ¤
> ¤ My problem now is, I want to know when the application is finished with
> the
> ¤ file so I can prompt the user and ask if they want to store the changes
> (if
> ¤ any) back in the database (similar to how outlook works when editing an
> ¤ attachment).
> ¤
> ¤
> ¤
> ¤ I know I can use SystemFileWatcher to be notified when the file is
> written
> ¤ to but that could happen more than once (intermediate saves) while the
> user
> ¤ is editing the file. I only want to prompt the user once. It doesn't
> have an
> ¤ event to see when the file is closed, just modified, etc.
> ¤
> ¤
> ¤
> ¤ Also, I need to clean up the temp file when the user is done with it but
> I
> ¤ don't know how to detect when the user shuts down the process that is
> ¤ viewing the file (I don't even know which process is being used or if
> it's
> ¤ using a shared process (in the case of Excel) or it's own in the case of
> ¤ Word, etc.
> ¤
> ¤
> ¤
> ¤ Does anyone know how to detect when a file is closed or know another way
> to
> ¤ deal with this issue?
> ¤
>
> One thing you can try is handling the Close event from the automation
> client:
>
> How To Handle Events for Microsoft Word Using Microsoft Visual Basic .NET
> http://support.microsoft.com/default.aspx?scid=kb;en-us;302816
>
>
> Paul ~~~ pclement@ameritech.net
> Microsoft MVP (Visual Basic)



Relevant Pages

  • [Full-disclosure] [Fwd: The New World of Work]
    ... Microsoft has evolved to build bridges between ... information workers spend up to 30 percent of their working day just ... agile and productive in the global economy is to stop automation and the ... attend useless business meetings. ...
    (Full-Disclosure)
  • Re: Preventing website loading up automatically
    ... > Everyone time I open up IE and got to an internet site eg Hotmail, ... Microsoft has these suggestions for Protecting your computer from the ... keep it clean,secure and running at its top performance mark. ... However, not everyone wants to be a slave to automation, and that is ...
    (microsoft.public.windows.inetexplorer.ie6.browser)
  • MumbaiITPro Community Leadership Opportunity
    ... The MumbaiITPro User Group, a Microsoft User Group in Mumbai, India ... offline) as well as the Microsoft Virtualization Community Launch ... host our launch event around Windows Server 2008 Hyper-V, ...
    (microsoft.public.windows.server.general)
  • MumbaiITPro Community Leadership Opportunity
    ... The MumbaiITPro User Group, a Microsoft User Group in Mumbai, India ... offline) as well as the Microsoft Virtualization Community Launch ... host our launch event around Windows Server 2008 Hyper-V, ...
    (microsoft.public.windows.terminal_services)
  • Re: International Energy Agency accepts Peak Oil (sortof)
    ... > Launch capability at some small fraction of the current. ... There really is no need for automation except in so far as ... launch operation should yield a cost of around $10/kg to LEO. ... SPS economics. ...
    (sci.energy)