document.open problem

N

nick brandwood

I have two problems calling documents.open from access 2003 ...

the first problem is that it does not seem to disable macros even if I put
the secruity protection on very high.

opening the file directly however disables the same macro.

the second problem I have is that I am opening documents from outside
sources, and some of these documents are corrupted. When it attempts to open
a corruputed document, I get a runtime error 5121, error trapping within
Access does not block this error. should I be using a different error
trapping technique?


On Error GoTo FileErrorContinue
objApp.Documents.Open FileName:=strToBeSearched & arrFiles(n),
ReadOnly:=True, OpenAndRepair:=True, NoEncodingDialog:=True

Run.time error '5121':
Word experienced an error trying to open the file.
Try these suggestions.

* Check the file permissions for the document or drive.
* Make sure there is sufficient free memory and disk space.
* Open the file with the TextRecovery center

It is acceptable for the code to skip over any file that fails to open.


thanks,

nick
 
N

nick brandwood

ok... dealt with the error detection problem.
the other problem is still not blocking macros.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top