Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Word97 minimizes after next line if code after activatio
Message
De
29/09/1999 03:40:37
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
28/09/1999 21:30:12
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00270311
Message ID:
00270367
Vues:
21
>Hi Out there,
>
>I use Word97 as an automation server by coding the following in the click event of a command button.
>
>oWord = CreateObject("Word.Application")
>with oWord
> .Windowstate=0 &&
> .visible = .t.
> .document(add)
>endwith
>
>
>Word opens, a new dociment is dosplayed and Word remains open and in WINDOWSTATE=0 until I hit the close button. That is the functionality I want. However, if I place the simplest command after the endwith line, ie: messagebox('HI'), Word minimizes and that line of code executes. I don't want that line of code to execute until I close Word.
>
>How do you do it?
>
>Thanx Neil
>dadigidoc@aol.com


Hi Neil,
If type("gHwndWord") = "U"
  Public gHwndWord
Endif

Declare integer GetForegroundWindow in WIN32API
Declare short IsWindow in WIN32API integer

********************
* Create word object
********************
If type("oWordDocument") = "O" ;
    and type("gHwndWord") = "N" ;
    and IsWindow(gHwndWord) # 0 && Check if word window is alive
  oWordDocument=getobject(, "Word.application")	&& get instance
Else
  oWordDocument=createobject("word.application") && Create word object
Endif
********************
* Create word object
********************

With oWordDocument
*...
Endwith

gHwndWord = GetForegroundWindow() && Save word window handle
Do while IsWindow(gHwndWord) # 0  && Wait while Word is alive
Enddo
Clear dlls
oWordDocument=.Null.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform