Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to close a specific word document
Message
From
25/09/2002 09:13:30
Victor Verheij
International Film Festival Rotterdam
Rotterdam, Netherlands
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Title:
How to close a specific word document
Miscellaneous
Thread ID:
00704183
Message ID:
00704183
Views:
59
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
Next
Reply
Map
View

Click here to load this message in the networking platform