Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to close a specific word document
Message
De
25/09/2002 09:13:30
Victor Verheij
International Film Festival Rotterdam
Rotterdam, Pays-Bas
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Titre:
How to close a specific word document
Divers
Thread ID:
00704183
Message ID:
00704183
Vues:
60
I want to close a specific word document e.g. if its open.
I do not want to close the whole word application.

I've found some code but they all close whole application.
for example:

DECLARE INTEGER ShowWindow IN win32api INTEGER,INTEGER
DECLARE INTEGER BringWindowToTop IN Win32API INTEGER hWnd

lnHand=CheckWin("Document1 - Microsoft Word")

#DEFINE WM_QUIT 0x12

DECLARE SHORT PostMessage In USER32.DLL ;
INTEGER hWnd, ;
INTEGER uMsg, ;
INTEGER wParam, ;
INTEGER lParam

IF lnHand>0
=PostMessage(lnHand,WM_QUIT,0,0)
ENDIF
RETURN

PROCEDURE CheckWin
PARAMETER tcTitle

DECLARE INTEGER FindWindow in Win32API as FindWindow STRING, STRING
lnhand=FindWindow(0,tcTitle)
RETURN lnhand

tia victor
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform