Information générale
Catégorie:
Fonctions Windows API
Titre:
How to close a specific word document
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
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement