|
-
Jan 6th, 2004, 02:35 PM
#1
Thread Starter
New Member
Coding around a 'file in use' message
I am working with an application that uses Word to convert ugly documents into 'pretty' documents...with this application a user has the ability to send a batch file through, because I have several converters running I ran into a problem where their files were being printed out of order from what the batch file was sent. So I fixed this by creating a macro in word to temporarily store the files in a batch to a folder, once all the files in that batch are processed, the marco sends the files to the printer.
The problem I'm having now is that occasionally I get a "file in use" message, which stops the processing until someone physically chooses an option of either 'Read Only', 'Notify' or 'Cancel'. I'm wondering if there is a way to code my macro to watch for this message and always choose the 'read only' option so that the process doesn't have to be baby-sat. I found a section in my book for error handling, but I need to be able to identify the error number, and there is not an error number on the window message that comes up. Once the 'Read only' button is pressed, the files go on to print like they should.
Any ideas?
-
Jan 7th, 2004, 04:28 AM
#2
Addicted Member
This may help (copied from VB Editor Help 'Number Property' - where there is more info.)
'------------------------------------------
Sub test()
On Error GoTo out
Dim x, y
x = 1 / y ' Create division by zero error
Exit Sub
out:
MsgBox Err.Number
MsgBox Err.Description
' Check for division by zero error
If Err.Number = 11 Then
y = y + 1
End If
Resume
End Sub
'-------------------------------------------
Regards
BrianB
-------------------------------
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|