Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. articles. downloads. faq. members. files. rss.
 From: Koen Piller
  Where is Koen Piller?
 Santpoort-Zuid
 Netherlands
 Koen Piller
 To: Hans de Groot
  Where is Hans de Groot?
 Den Haag
 Netherlands
 Hans de Groot
Subject: RE: Getobject / Createobject
Thread ID: 183878 Message ID: 184210 # Views: 2 # Ratings: 0
Version: Visual FoxPro 9 Category: Microsoft Office Automation
Date: Thursday, July 17, 2008 9:34:02 AM         
   



> Hi,
>
> I use CREATEOBJECT("Word.Application") to start Office automation from VFP.
> However, when a user allready has an instance of MS Word open and I close the automation from VFP,
> Word gives a message that the normal.dot file is in use and cannot be overwritten.
> Clearly, the two Word sessions interfere.
>
> To avoid that, I first try GETOBJECT(,"Word.Application"), which connects to an existing Word instance.
> If GETOBJECT() indicates that there is no running instance, you can trap that error and use CREATEOBJECT() instead.
>
> What bothers me, is that when I use GETOBJECT(), there seems no way to know that the Word instance you get access to has a modal dialog open, for example a 'File Open' dialog.
>
> In that case, I can't use that Word instance, because it is not accessible for the automation I want to do.
>
> My question: is there a way to determine that a Word instance has a modal dialop open?
>
> Thanks, Hans

Hans,

you could try to implent in your closing of Word:

oWord.NormalTemplate = .t.

This should do the job for you to answer the question about a changed Normal.dot

Regards,

Koen

ENTIRE THREAD

Getobject / Createobject Posted by Hans de Groot @ 7/15/2008 5:53:45 PM
RE: Getobject / Createobject Posted by Barbara Peisch @ 7/15/2008 8:41:43 PM
RE: Getobject / Createobject Posted by Yousfi Benameur @ 7/16/2008 3:17:15 AM
RE: Getobject / Createobject Posted by Barbara Peisch @ 7/16/2008 4:47:46 AM
RE: Getobject / Createobject Posted by Yousfi Benameur @ 7/16/2008 8:06:03 PM
RE: Getobject / Createobject Posted by Barbara Peisch @ 7/16/2008 9:44:03 PM
RE: Getobject / Createobject Posted by Hans de Groot @ 7/16/2008 6:59:00 AM
RE: Getobject / Createobject Posted by Yousfi Benameur @ 7/16/2008 8:26:48 AM
RE: Getobject / Createobject Posted by Christof Wollenhaupt @ 7/16/2008 10:51:35 AM
RE: Getobject / Createobject Posted by Koen Piller @ 7/17/2008 9:34:02 AM
RE: Getobject / Createobject Posted by Hans de Groot @ 8/8/2008 10:49:34 AM
RE: Getobject / Createobject Posted by Yousfi Benameur @ 8/8/2008 11:38:08 AM