Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / June 2005

Tip: Looking for answers? Try searching our database.

document.open problem

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
nick brandwood - 07 Jun 2005 16:32 GMT
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
nick brandwood - 08 Jun 2005 13:00 GMT
ok... dealt with the error detection problem.
the other problem is still not blocking macros.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.