In a message dated 99-02-18 16:49:49 EST, you write:
The syntax for a retrieval is:
Application.Documents.Receive(myDocName)
where myDocName is filled with a supposedly valid document name. If the
name
is invalid, the script currently stops. I need a way to trap the failure,
log
an error, and continue. Of course if the name is correct, everything works
fine.
Solved my own problem, just had to stop and think about it for a while. The
following code (which was obvious, in retrospect) will do the trick of
retrieving a document, and trapping the error if the document is not
available.
Function RepoFileExist (myFileName$)
’ First Check to ensure that myFileName is a valid file in the repository
On Error Goto NotFound ’ provide alternate error handling
’ attempt to retrieve file
Application.Documents.Receive(myFileName$)
On Error Resume Next ’ if success, restore default error
handling
RepoFileExist = True
Exit Function
NotFound:
On Error Resume Next
RepoFileExist = False
LogError (“File " & myFileName$ & " not available in repository.”)
End Function ’ Repository File Exists
Calling the function looks something like this:
If RepoFileExists (document_name) Then
… do file process stuff here…
Else
… log to error file here
end if
Since the function retrieves the file if it exists, the processing loop can
start with the assumption that the file is present. It does, however, seem to
want to only retrieve the file to the standard BusObj document directory.
So, thanks for any consideration you may have given to my question, but I seem
to have solved it!
Regards,
Dave Rathbun
Integra Solutions
www.islink.com
Listserv Archives (BOB member since 2002-06-25)