|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
Error if the word doc is already opened on the server
Hi friends,
I am using VB and asp for making mailmerge sort of application.. The word automation part i have written in VB dll. When the file is already opened on the server i get error as "File is used by another process". How do i check whether the file is already opened and then close this file.. Plz help me out with this.. some hundreds of people use this application and when one person also doesnt do the complete processing word doc remains opened.. so after that whoever tries to execute this page it gives them error.. any help will be appreciated. Thanx in advance Fehmina...
__________________
Do, or do not. There is no 'try'. |
|
#2
|
||||
|
||||
|
to check if the file is already open you can catch errors and check
error message. to close it, I guess there are low level commands in VB that work directly with Processes - one of them should give you the ability to close running process. but if some people work on the same file in the same time it won't be very good thing to do. better approach IMO is creating copy of the file for each user. |
|
#3
|
||||
|
||||
|
I am checking whether the file was modified since last 10 minutes.. cn u tell me the command by which i cn kill word process..
Quote:
|
|
#4
|
||||
|
||||
|
Quote:
documentations I'm quite sure there are process-related commands. |
|
#5
|
||||
|
||||
|
I am able to solve it with the help of one exe.
Quote:
|
|
#6
|
|||
|
|||
|
Well, if I understood you correctly, and you don't want to use that seperate exe, here's what you're looking for.
Code:
Private Declare Function TerminateProcess Lib "kernel32" (ByVal hProcess As Long, ByVal uExitCode As Long) As Long |
![]() |
| Viewing: ASP Free Forums > Programming > Visual Basic Programming > Error if the word doc is already opened on the server |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|